flutter_swiper
flutter_swiper copied to clipboard
Page indicator colors
When screen open with swiper on it, Indicator color shows in black and then changed to the color that i choose in DotSwiperPaginationBuilder
that's my code:
new Swiper( itemBuilder: (BuildContext context, int index) { return new Container( padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( introContent[index], fit: BoxFit.contain, height: MediaQuery.of(context).size.height * 0.205, width: MediaQuery.of(context).size.width * 0.5912, ), SizedBox( height: MediaQuery.of(context).size.height * 0.05, ), Text( AppLocalizations.of(context) .translate('intro_title_${index + 1}'), style: Theme.of(context) .textTheme .headline5 .copyWith(height: 1.4), textAlign: TextAlign.center, ), SizedBox( height: 12, ), Text( AppLocalizations.of(context) .translate('intro_content_${index + 1}'), style: Theme.of(context).textTheme.subtitle1.copyWith( color: AppColors.charcoal100, height: 1.6), textAlign: TextAlign.center, ) ], )); }, autoplayDelay: 5000, indicatorLayout: PageIndicatorLayout.SCALE, autoplay: true, itemCount: introContent.length, pagination: new SwiperPagination( alignment: Alignment.bottomCenter, builder: new DotSwiperPaginationBuilder( space: 8, size: 12, activeSize: 12, color: AppColors.silverGreen, activeColor: AppColors.darkBlueGreen), ), ),
If anyone else has this issue in the future, I found that setting:
indicatorLayout: PageIndicatorLayout.NONE
Solved the issue. The size
and activeSize
parameters of DotSwiperPaginationBuilder
will give you active and not active page size difference.
Hope this helps!