Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

ASHISH RANJAN
ASHISH RANJAN

Posted on

Flutter - Triangular CAROUSEL Slider

Image description

i want to make a carousel like this so basically there are 5 items there can be more...
but at time 5 items should be visible on the screen .. upon dragging should change positions... left and right both just like how a normal slider works

i have tried to make a design with the stack widget but i dont know how can i convert into a slider or add any other logics to achive this.

class TriangularCarousel extends StatelessWidget {  @override  Widget build(BuildContext context) {    return Container(      height: 45.h,      width: 100.w,      child: Stack(        children: [          Positioned(            top: 0,            left: 0,            child: Opacity(                opacity: 0.4,                child: Image.asset(                  "assets/logo.png",                  height: 45.h * 0.25,                )),          ),          Positioned(            top: 45.h * 0.15,            left: 100.w * 0.1,            child: Opacity(              opacity: 0.6,              child: Image.asset(                "assets/logo.png",                height: 45.h * 0.38,              ),            ),          ),          Positioned(            bottom: 0,            left: 100.w * 0.2,            right: 100.w * 0.2,            child: Image.asset(              "assets/logo.png",              height: 45.h * 0.7,            ),          ),          Positioned(            top: 45.h * 0.15,            right: 100.w * 0.1,            child: Opacity(              opacity: 0.6,              child: Image.asset(                "assets/logo.png",                height: 45.h * 0.38,              ),            ),          ),          Positioned(            top: 0,            right: 0,            child: Opacity(              opacity: 0.3,              child: Image.asset(                "assets/logo.png",                height: 45.h * 0.25,              ),            ),          ),        ],      ),    );  }}
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp