'Flutter how to trigger exit animation
When I enter the page I animate a container with a Siding animation. And it is triggered trough the provider.
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation, animation2) {
return ListenableProvider(
create: (context) => animation,
child: LoginPage(),
);
},
transitionDuration: const Duration(milliseconds: 500),
),
);
But now I want to do the same animation but in reverse when I go to the next page. the animation now is only playing if I go back to the last page. I can not find one good explanation how to do this.
I found a suitable solution, so when i navigate to the next page I use Navigator.popAndPushNamed but then before the animations ends the page transition animations begins so it don't has enough time to finish the animation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
