Flutter Smooth PageView indicators

Overview

smooth_page_indicator

Customizable animated page indicator with a set of built-in effects.

MIT License stars pub version Buy Me A Coffee


infinite Loop support [new]

Scrolling dots effect

Effects

Effect Preview
Worm
Worm style = WormStyle.thin [v1.0.0]
Expanding Dots
Jumping dot
Jumping dot with vertical offset [v1.0.0]
Scrolling Dots -> 0.1.5
Slide
Scale
Swap
Swap type = SwapType.yRotation [v1.0.0]
Color Transition [0.1.2]
Customizable demo-1 [v1.0.0]
Customizable demo-2 [v1.0.0]
Customizable demo-3 [v1.0.0]
Customizable demo-4 [v1.0.0]

Usage


SmoothPageIndicator uses the PageController's scroll offset to animate the active dot.

SmoothPageIndicator(  
   controller: controller,  // PageController  
   count:  6,  
   effect:  WormEffect(),  // your preferred effect  
   onDotClicked: (index){  
         
   }  
)  
  

Usage without a PageController [v0.2.0+]


Unlike SmoothPageIndicator , AnimatedSmoothIndicator is self animated and all it needs is the active index.

AnimatedSmoothIndicator(  
   activeIndex: yourActiveIndex,  
   count:  6,  
   effect:  WormEffect(),  
)  
  

Customization


You can customize direction, width, height, radius, spacing, paint style, color and more...

SmoothPageIndicator(  
   controller: controller,  
   count:  6,  
   axisDirection: Axis.vertical,  
   effect:  SlideEffect(  
      spacing:  8.0,  
      radius:  4.0,  
      dotWidth:  24.0,  
      dotHeight:  16.0,  
      paintStyle:  PaintingStyle.stroke,  
      strokeWidth:  1.5,  
      dotColor:  Colors.grey,  
      activeDotColor:  Colors.indigo  
   ),  
)  
  

RTL Support


Smooth page indicator will inherit directionality from its ancestors unless you specify a directionality by passing it directly to the widget or wrapping the Indicator with a Directionality widget from the flutter package.

SmoothPageIndicator(  
   controller: controller,  // PageController  
   count:  6,  
  
   // forcing the indicator to use a specific direction  
   textDirection: TextDirection.rtl  
   effect:  WormEffect(),  
);  
  

Support the Library

You can support the library by liking it on pub, staring in on Github and reporting any bugs you encounter.

Comments
  • Getting this error when last item was removed

    Getting this error when last item was removed

    Current page is out of bounds 'package:smooth_page_indicator/src/painters/indicator_painter.dart': Failed assertion: line 26 pos 16: 'offset.ceil() < count'

    opened by TBoonkwan 10
  • Required horizontal scroll for ExpandingDotsEffect

    Required horizontal scroll for ExpandingDotsEffect

    Required horizontal scroll for ExpandingDotsEffect when no. of dots goes beyond screen. It works well when there are few pages. But no of pages are big then it sense like there is no indication for current page.

    opened by pravin-sorigin 3
  • Add loop

    Add loop

    Please, add loop for SmoothPageIndicator. I can make loop in scroll page view, like that PageView.builder( __controller: pageController, __ onPageChanged: (int page) {}, itemBuilder: (context, index) { return _children[index % _children.length]; }, ), but for SmoothPageIndicator is not available .

    opened by maksimivanchuk 3
  • Enable applying a different colour for an indicator based on the index

    Enable applying a different colour for an indicator based on the index

    I'm using this as part of a wizard-like question form. Once a user has successfully completed a section, or chosen to skip, we move on to the next screen. I'd like to be able to set the colour of the indicator to reflect the completed or skipped state.

    Ideally, there'd be a way to specify the appearance of a dot at a given index, maybe via a builder.

    opened by dev-horacebg 2
  • Use indicator without controller

    Use indicator without controller

    The plugin takes a pageview controller as a required parameter, so I can't seem to use it with alternatives such as carousel_slider, is there any way to use the two.

    opened by Prn-Ice 2
  • Add support for ValueNotifier

    Add support for ValueNotifier

    It would be very pleasing if we can see a support for ValueNotifier since we may use this not only with PageView. For example i am using a CarouselSlider and therefore it would be nice to have this feature :)

    opened by fly-qp 1
  • ScrollEffect: active dot is not aligned with underlying dot

    ScrollEffect: active dot is not aligned with underlying dot

    The active dot misses the underlying dot with approximately 1 pixel when I use ScrollEffect. This does not occur for other effects afaik.

    image

    Thanks for a great package!

    opened by Kal-Elx 1
  • Implement indicators with Axis.vertical scroll direction

    Implement indicators with Axis.vertical scroll direction

    Currently the package does not support using it with PageView's scrollDirection: Axis.vertical.

    Instead of rendering this:

    image

    It should render in Y axis:

    image

    Maybe a parameter scrollDirection must be implemented:

    SmoothPageIndicator(
      controller: pageController,
      scrollDirection: Axis.vertical,
    );
    
    opened by JHBitencourt 1
  • On click property

    On click property

    Would be really great to have onClick propery on SmoothPageIndicator, something that looks like this:

    SmoothPageIndicator(
        count: 3,
        controller: _c,
        onClick: (int page){
            // todo
        });
    
    opened by marchellodev 1
  • Initial page modifications not visialized

    Initial page modifications not visialized

    Hi! I have been looking through your work and found out that on modifications of the initial page on the PageController, on the first visualization the dot is active at the first place anyway. I am using this: final pageCtrl = PageController(viewportFraction: 1.0, initialPage: 1); Together with the following indicator: child: SmoothPageIndicator( controller: pageCtrl, count: 2, effect: ColorTransitionEffect(), ),

    So, the dot on 0 is marked but the page on 1 is displayed. I found it a bit randomly and do not need it! But I though maybe you'd like to know :) Thanks for developing!

    opened by IrisBC 1
  • dotColor being a list rather than one color

    dotColor being a list rather than one color

    Hey guys,

    I'm moving over from using dots_indicator (https://pub.dev/packages/dots_indicator) since you guys have a nicer UI and customization options, but I'm realizing I can't have control of each individual dotColor.

    dots_indicator allows you to specify a list of dotColors which allows for far more custom implementations.

    I'm wondering if this is a feature that others might also enjoy?

    Thanks.

    opened by amjadhassoun123123 0
  • Wrong margin in AnimatedSmoothIndicator with ScaleEffect

    Wrong margin in AnimatedSmoothIndicator with ScaleEffect

    AnimatedSmoothIndicator with ScaleEffect has an additional margin on the right size, which causes a slight offset when wrapping the indicator in a Center widget.

    These are the settings I'm using:

    AnimatedSmoothIndicator(
        activeIndex: index,
        count: count,
        effect: ScaleEffect(
            activeDotColor: colorScheme.primary,
            dotColor: colorScheme.primaryContainer,
            spacing: 8,
            dotWidth: 8,
            dotHeight: 8,
        ),
    ),
    

    This is the result with Show guidelines enabled: scale_effect_margin

    The margin on the right shouldn't be there.

    opened by TheManuz 0
  • SmoothPageIndicator work with CarouselSlider

    SmoothPageIndicator work with CarouselSlider

    before SmoothPageIndicator works fine with CarouselSlider since it just needs an activeIndex, but the current version of SmoothPageIndicator need a Pagecontroller, and what I have is a CarouselController, how could I transfer this CarouselController to a pagecontroller?

    SmoothPageIndicator(
                  controller: _pageController // here I only have a CarouselController
                  count: controller.photoFrameList.length + 1,
                  effect: WormEffect(
                    activeDotColor: AppColors.sadColor,
                    dotColor: AppColors.sadColor.withOpacity(0.4),
                    dotHeight: 8,
                    dotWidth: 8,
                    type: WormType.thin,
                    // strokeWidth: 5,
                  ),
                ),
    

    thank you!

    opened by peterbullmatti 3
  • flutter pub get failed on adding smooth_page_indicator: ^1.0.0+2

    flutter pub get failed on adding smooth_page_indicator: ^1.0.0+2

    on adding smooth_page_indicator: ^1.0.0+2 in pubsec.yml

    it always through an error with the message:

    pub get failed (server unavailable) -- attempting retry 1 in 1 second...```
    opened by shivanuj13 0
Owner
Milad akarie
Interested in Native Android development, Kotlin, Flutter and Dart.
Milad akarie
A Flutter PageView Indicator has Worm animation

Worm Indicator A Flutter PageView indicator insprired by worm animation. It can be easily integrated with any Flutter PageView. Pull requests are welc

Phuc Huynh 11 May 3, 2022
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.

✨ Flutter Spinkit A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit. ?? Installing dependencies:

Jeremiah Ogbomo 2.7k Dec 30, 2022
Add an indicator for a progression. You can customize indicators (shape, color, ..)

dots_indicator Widget to display dots indicator to show a position (for a PageView for example). Installation You just need to add dots_indicator as a

Jean-Charles Moussé 139 Dec 1, 2022
A collection of loading indicators animated with CSS

SpinKit Simple loading spinners animated with CSS. See demo. SpinKit only uses (transform and opacity) CSS animations to create smooth and easily cust

Tobias Ahlin 19k Dec 26, 2022
A package to create nice and smooth animations for flutter

animation_director A package to create nice and smooth animations for flutter Introduction A simple package to build beautiful and smooth animations f

null 10 Nov 28, 2022
🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]

Animated Text Kit A flutter package which contains a collection of some cool and awesome text animations. Recommended package for text animations in C

Ayush Agarwal 1.4k Jan 6, 2023
This repository demonstrates use of various widgets in flutter and tricks to create beautiful UI elements in flutter for Android and IOS

AwesomeFlutterUI The purpose of this repository is to demonstrate the use of different widgets and tricks in flutter and how to use them in your proje

Subir Chakraborty 132 Nov 13, 2022
This is a Flutter URL preview plugin for Flutter that previews the content of a URL

flutter_link_preview This is a URL preview plugin that previews the content of a URL Language: English | 中文简体 Special feature Use multi-processing to

yung 67 Nov 2, 2022
Flutter liquid swipe - Liquid Swipe Animation Built With Flutter

Flutter Liquid Swipe liquid Swipe animation is amazing and its Created for iOS P

Jahongir Anvarov 6 Dec 1, 2022
A candy sorter game made with Flutter for the march flutter challenge.

A candy sorter game made with Flutter for the march flutter challenge.

Debjeet Das 1 Apr 9, 2022
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).

drawing_animation From static SVG assets See more examples in the showcasing app. Dynamically created from Path objects which are animated over time m

null 442 Dec 27, 2022
Flutter package for creating awesome animations.

?? Simple Animations Simple Animations is a powerful package to create beautiful custom animations in no time. ?? fully tested ?? well documented ?? e

Felix Blaschke 879 Dec 31, 2022
Fun canvas animations in Flutter based on time and math functions.

funvas Flutter package that allows creating canvas animations based on time and math (mostly trigonometric) functions. The name "funvas" is based on F

null 472 Jan 9, 2023
A flutter package that adds support for vector data based animations.

animated_vector Description and inspiration A package that adds support for vector data based animations. The data format is heavily inspired from the

Potato Open Sauce Project 6 Apr 26, 2022
Flutter UI Challenges

Introduction ?? Zoo is a small, simple and beautiful app that lists 3d model of animals. Before we start, you can take a look at the app: Usage ?? To

Sanjeev Madhav 58 Dec 22, 2022
A Flutter app with flip animation to view profiles of friends. 🌟

Flip View Made with ?? in India This flutter app is based on the design made Dmytro Prudnikov for Yalantis on Dribble.He describes the design as: Just

Shubham Soni 68 Sep 23, 2022
Simple reactive animations in your Flutter apps.

just.motion Flutter package to create organic motion transitions. Why? The Motion Value stateless hot reload status notifier Ease Motion Spring Motion

Roi Peker 49 Nov 14, 2022
Timer UI animation challenge from 'Flutter Animations Masterclass'

stopwatch_flutter An IOS stopwatch challenge from Flutter Animations Masterclass - Full Course What I learned; Use timer Use ticker Create custom shap

Ali Riza Reisoglu 11 Jan 4, 2023
💙 Google Classroom Clone using Flutter, GCP

Introduction ?? Classroom is a Google Classroom clone built using ?? Flutter. Before we start, you can take a look at the app: Screenshots ?? Key Feat

Sanjeev Madhav 20 Dec 14, 2022