Code
class DotIndicator extends StatelessWidget { DotIndicator({super.key}); final _controller = PageController(); @override Widget build(BuildContext context) { return Scaffold( body: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ SizedBox( height: 500, child: PageView( controller: _controller, children: [ Padding( padding: const EdgeInsets.all(10), child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.deepPurple, ), height: 400, ), ), Padding( padding: const EdgeInsets.all(10), child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.deepPurple, ), height: 400, ), ), Padding( padding: const EdgeInsets.all(10), child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.deepPurple, ), height: 400, ), ), Padding( padding: const EdgeInsets.all(10), child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.deepPurple, ), height: 400, ), ) ], ), ), SmoothPageIndicator( controller: _controller, count: 4, // effect: ExpandingDotsEffect( // activeDotColor: Colors.deepPurple, // dotColor: Colors.deepPurple.shade300, // dotHeight: 20, // dotWidth: 20, // spacing: 10, // ), // effect: SwapEffect( // activeDotColor: Colors.deepPurple, // dotColor: Colors.deepPurple.shade300, // dotHeight: 20, // dotWidth: 20, // spacing: 10, // ), effect: JumpingDotEffect( activeDotColor: Colors.deepPurple, dotColor: Colors.deepPurple.shade300, dotHeight: 20, dotWidth: 20, spacing: 10, verticalOffset: 20, // jumpScale: 0, ), ) ], ), ); } }
Flutter PackAge
Tags:
Flutter