我是来自的自定义代码 https://pub.dartlang.org/packages/intro_slider#-readme-tab-
但是如何使切换屏幕的逻辑不会滞后,因为当屏幕充满时点会移动100%,而不是51%
List<Widget> renderListDots() {
dots.clear();
for (int i = 0; i < slides.length; i++) {
Color currentColor;
if (tabController.index == i) {
currentColor = colorActiveDot;
dots.add(renderDotCustom(sizeActiveDot, currentColor));
} else {
currentColor = colorDot;
dots.add(renderDot(sizeDot, currentColor));
}
}
return dots; }
Widget renderDot(double radius, Color color) {
return Container(
decoration: BoxDecoration(
color: color, borderRadius: BorderRadius.circular(radius / 2)),
width: radius,
height: radius,
margin: EdgeInsets.all(6),
);}
Widget renderDotCustom(double radius, Color color) {
return Container(
decoration: BoxDecoration(
color: color, borderRadius: BorderRadius.circular(radius / 2)),
width: 30.0,
height: 8.0,
margin: EdgeInsets.all(6),
);}