duytq94 / flutter-intro-slider

Simple and configurable app introduction slider for Flutter
https://pub.dartlang.org/packages/intro_slider
MIT License
677 stars 141 forks source link

[FIX] Fix trouble with double call on callback onTabChangeCompleted #60

Closed JesusZapata closed 4 years ago

JesusZapata commented 4 years ago

Before call onTabChangeCompleted check if the indexIsChanging

...
onTabChangeCompleted: (step) {
    print(step)
}
...

Before apply the patch the output is

I/flutter (19184): 1
I/flutter (19184): 1

After apply the patch the output is

I/flutter (19184): 1
JesusZapata commented 4 years ago

@duytq94 Check if this change it is useful

duytq94 commented 4 years ago

Hi, @JesusZapata thanks for your pull request. I knew this issue, but if you check indexIsChanging, the callback onTabChangeCompleted won't be called when a user swipes their finger (just call when clicking the next/previous button). Do you get any idea?