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

Enhance onPressed callbacks to support better analytics #140

Open sishyanet opened 1 year ago

sishyanet commented 1 year ago

I'd like to add some analytics to the intro slider, and want to suggest a couple of changes. Happy to send a PR if you think these are good ideas:

  1. onNextPress callback should be a function that takes a parameter (int) that gives the index of the slide the user is swiping to.
  2. Add a new callback, onPrevPress, to make it consistent with the other buttons, taking a parameter (int) as above.
  3. Add a callback, onSlide, that takes a parameter (int), and which the caller can listen to for whenever the user enters a different slide.

This will be helpful to collect analytics about which slides users are visiting, and/or performing A/B tests to figure out the performance of different slide designs.

duytq94 commented 1 year ago

Hi, thanks for your raised issue. I think 1 & 2 are fine, but at 3 we already have onTabChangeCompleted, is it got what you need?