flutter_carousel_slider
flutter_carousel_slider copied to clipboard
Callback when user try to scroll from first/last page
is there a way to get a callback so that when the user reached the first/last page and then tried to scroll to previous page (if current page is first) or scroll to next page (if current page is last)
Hi, I think you can achieve this feature by using the onPageChanged callback.
I found a solution for skipping slider by scrolling on last page 👍
My Steps:
- Add another (empty) slide at the end of the slide list.
- Add condition onPageChanged body for last slide
onPageChanged: (index, _) {
if (index < slideList.length - 1)
setState(() {
_current = index;
});
else
Navigator.pushNamedAndRemoveUntil(context,.....);