_controller = SwipableStackController()
..addListener(() {
if (_users.length - 1 <= _controller.currentIndex) {
print('loading more users');
}
setState(() {});
});
But when the last card is being swiped then listener is executed extremely times:
11 I[/flutter]() ( 6322): loading more users
11 I[/flutter]() ( 6322): loading more users
11 I[/flutter]() ( 6322): loading more users
11 I[/flutter]() ( 6322): loading more users
2.
I thought: ok, so when the last card is shown I can use onSwipeCompleted callback to reset currentItem = 0 but didn't work because the library internally execute +1 on currentIndex, then SwipableStack shows again the last card.
Hi, I have a problem when end of the stack came. I implemented two ways but I didn't success.
1. Following this issue https://github.com/HeavenOSK/flutter_swipable_stack/issues/12 I added a listener like you suggested:
But when the last card is being swiped then listener is executed extremely times:
2. I thought: ok, so when the last card is shown I can use
onSwipeCompleted
callback to resetcurrentItem = 0
but didn't work because the library internally execute +1 on currentIndex, thenSwipableStack
shows again the last card.Is there a solution for this problem?.
Thank you!!