IntroViews-Flutter icon indicating copy to clipboard operation
IntroViews-Flutter copied to clipboard

Add animation for click button skip, next, back

Open khanhuitse05 opened this issue 5 years ago • 0 comments

First! Thank for your package. It saves me a lot of time. Hope I can help you with this "Request"

--> This is my code

...
void animationToPage(int page) {
    nextPageIndex = page;
    animatedPageDragger = AnimatedPageDragger(
      slideDirection: activePageIndex > nextPageIndex
          ? SlideDirection.leftToRight
          : SlideDirection.rightToLeft,
      transitionGoal: TransitionGoal.open,
      slidePercent: slidePercent,
      slideUpdateStream: slideUpdateStream,
      vsync: this,
    );
    animatedPageDragger.run();
  }
...

  void onPressedBack() {
    animationToPage(max(0, activePageIndex - 1));
  }

  void onPressedNext() {
    animationToPage(min(widget.pages.length - 1, activePageIndex + 1));
  }

  void onPressedSkip() {
    animationToPage(widget.pages.length - 1);
  }
...

khanhuitse05 avatar May 07 '20 10:05 khanhuitse05