0

How could I add transition animation when switching pages while using Stacks?

Here is example code which I've been using.

How to use BottomNavigationBar with Navigator?

Currently when you switch pages it's instant and not smooth.

user2698762
  • 1
  • 1
  • 3
  • Can you past the referred code in this question perhaps? This would make this question more reliable in the case of the linked post becomes being edited – Renan C. Araujo Oct 15 '18 at 15:02

2 Answers2

0

The linked implementation doesn't use any transition/animation.

Since you didn't specified which type of animation you want, I can't provide a simple solution.

However, you can easily implement your own Animation, there is lot of exemple on the official documentation : https://flutter.io/animations/

LucasFM
  • 148
  • 6
0

The code in your examples relies on the Offstage widget. There is no way to create a transition between offstage positive and negative. That is a case for using routes instead of Offstage along stacks.

For route changes, animations are implemented by the framework flavor you are using(eg: MaterialApp).

Check this tutorial for a more detailed guide of how to use BottomNavigationBar along with Routes.

Renan C. Araujo
  • 840
  • 2
  • 9
  • 14