Flutterpage.view builder show the left page only top left of page animation

47 Views Asked by At

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

There are 2 best solutions below

0
Suriya On

yes animateTo works exactly.Instead of animateToPage

0
Munsif Ali On

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,
    );