简体   繁体   English

如何更改 Flutter 中的 Swiper 分页颜色?

[英]How to Change Swiper pagination color in Flutter?

I am using Swiper as a slider in Flutter Activity i want to change Swiper dot indicator color from Blue(default) to custom, but i am unable to find the way how to change indicator color and also i want to change the location of indicator inside the container.我在 Flutter 活动中将 Swiper 用作 slider 我想将 Swiper 点指示器颜色从蓝色(默认)更改为自定义,但我无法找到如何更改指示器颜色的方法,并且我想更改指示器内部的位置容器。

i have found the solution of this problem by Adding the following code inside the Swiper widget.我通过在 Swiper 小部件中添加以下代码找到了解决此问题的方法。

 pagination: new SwiperPagination(
                alignment: Alignment.bottomCenter,
                builder: new DotSwiperPaginationBuilder(
                    color: Colors.grey, activeColor: Color(0xff38547C)),
              ),
              control: new SwiperControl(
                color: Color(0xff38547C),
              ),

After adding this code the output is like this:添加此代码后,output 是这样的: 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM