Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add animation for click button skip, next, back #70

Open
khanhuitse05 opened this issue May 7, 2020 · 0 comments
Open

Add animation for click button skip, next, back #70

khanhuitse05 opened this issue May 7, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@khanhuitse05
Copy link

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);
  }
...
@mzdm mzdm added the enhancement New feature or request label Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants