skip to Main Content

I have pageview. builder in this I have multiple cards. when I open the page I want to animate and show the second page just 20% of it and it needs to move back to its normal position.the aims here is to show the user that are multiple cards in the view.

animateToPage function does not work because it animates to the full page.

Expected: second card needs to swipe left 20% and needs to move back to the old position.

2

Answers


  1. Chosen as BEST ANSWER

    yes animateTo works exactly.Instead of animateToPage


  2. Use animateTo method with controller like this:

    await _controller?.animateTo(
          MediaQuery.sizeOf(context).width * 0.2, // this define how much you want to animate in this case it will animate 20 percent of the card.
          duration: Duration(seconds: 1),
          curve: Curves.easeInOut,
        );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search