Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I change SwiperPagination.dots color? #78

Closed
NTMS2017 opened this issue May 6, 2019 · 6 comments
Closed

How do I change SwiperPagination.dots color? #78

NTMS2017 opened this issue May 6, 2019 · 6 comments

Comments

@NTMS2017
Copy link

NTMS2017 commented May 6, 2019

Hi,

I need to change active and none active SwiperPagination.dots color. How do I do that?

Currently active color shows green and none active color shows white. Currently I have green background and cannot see active color. It simply shows none active page color with is white.

I need to change active and none active color based on my background picture. How can I do that?

Thanks for this great plugin.

@mrgray
Copy link

mrgray commented May 14, 2019

@NTMS2017 Did you ever figure this one out?

@NTMS2017
Copy link
Author

Not yet, do you know how to do it?

@lavanoped
Copy link

You have to change the package library itself. In the file, src/swiper_pagination.dart

class DotSwiperPaginationBuilder{
Widget build(BuildContext context, SwiperPluginConfig config) {
   ...
   Color activeColor = this.activeColor; //pick your color here =Colors.blueAccent
   Color color = this.color;  //pick your color here =Colors.blue

As far as I know. If you have to change the colors dynamically, then you might have to create added methods into Swiper or implement the whole package into your app's lib itself.

@NTMS2017
Copy link
Author

I will check it today, and yes I need to change the color dynamically. Thanks

@NTMS2017
Copy link
Author

Thank you very much its working

@NTMS2017 NTMS2017 reopened this May 17, 2019
@rstrelba
Copy link

rstrelba commented Jun 8, 2019

          pagination: new SwiperPagination(
              margin: new EdgeInsets.all(5.0),
              builder: new DotSwiperPaginationBuilder(
                  color: Colors.grey, activeColor: Colors.red)),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants