We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I noticed that when I had loop set to off, the buttons on the swiper control still looped. I added this to fix it in a class I copied.
This is the new buildButton in swiper_control.dart. *** means an added line
Widget buildButton(SwiperPluginConfig config, Color color, IconData iconDaga, int quarterTurns, bool previous) { return new GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { *** bool prevActivated = true; *** bool nextActivated = true; *** if (config.loop) { *** } else { *** nextActivated = config.activeIndex < config.itemCount - 1; *** prevActivated = config.activeIndex > 0; *** } if (previous) { *** if (prevActivated) config.controller.previous(animation: true); } else { *** if (nextActivated) config.controller.next(animation: true); } }, child: Padding( padding: padding, child: RotatedBox( quarterTurns: quarterTurns, child: Icon( iconDaga, semanticLabel: previous ? "Previous" : "Next", size: size, color: color, ))), ); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I noticed that when I had loop set to off, the buttons on the swiper control still looped. I added this to fix it in a class I copied.
This is the new buildButton in swiper_control.dart.
*** means an added line
Widget buildButton(SwiperPluginConfig config, Color color, IconData iconDaga,
int quarterTurns, bool previous) {
return new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
*** bool prevActivated = true;
*** bool nextActivated = true;
*** if (config.loop) {
*** } else {
*** nextActivated = config.activeIndex < config.itemCount - 1;
*** prevActivated = config.activeIndex > 0;
*** }
if (previous) {
*** if (prevActivated)
config.controller.previous(animation: true);
} else {
*** if (nextActivated)
config.controller.next(animation: true);
}
},
child: Padding(
padding: padding,
child: RotatedBox(
quarterTurns: quarterTurns,
child: Icon(
iconDaga,
semanticLabel: previous ? "Previous" : "Next",
size: size,
color: color,
))),
);
}
The text was updated successfully, but these errors were encountered: