flutter 如何创建带边框的滚动圆点

rvpgvaaj  于 2023-03-19  发布在  Flutter
关注(0)|答案(1)|浏览(157)

我怎样才能创建像这样的滚动点与边界scrolling dots

`SmoothPageIndicator(

                                  controller: controller,
                                  count: 3,
                                  effect:  const  ScaleEffect(
                                      scale: 1.5,
                                      dotHeight: 10,
                                      dotWidth: 10,
                                      dotColor: Colors.red,
                                      activeDotColor: Colors.grey,
                                      activePaintStyle: PaintingStyle.stroke,

                                      strokeWidth: 2

                                  ),
                                  onDotClicked: (index) {
                                    controller.animateToPage(index,
                                        duration: const Duration(milliseconds: 300),
                                        curve: Curves.easeInOut);
                                  },
                                  )`

下面是输出---------------〉Output of the my code
我试图达到第一个画面

5jvtdoz2

5jvtdoz21#

该效果适用于ScrollingDotsEffect.并设置fixedCenter:true。

SmoothPageIndicator(
            controller: _controller,
            count: 4,
            effect: const ScrollingDotsEffect(
                activeDotColor: Colors.pink,
                fixedCenter: true),
          )

相关问题