Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/src/swiper_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ class SwiperControl extends SwiperPlugin {
return new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
///condition onTap animation to loop status or presence of previous or next index (avoiding jump-loop).
bool isPrev = config.activeIndex > 0;
bool isNext = config.activeIndex < config.itemCount - 1;
if (previous) {
config.controller.previous(animation: true);
if (isPrev || config.loop) config.controller.previous(animation: true);
} else {
config.controller.next(animation: true);
if (isNext || config.loop) config.controller.next(animation: true);
}
},
child: Padding(
Expand Down