samit
samit

Reputation: 108

How to add animation to navigation in flutter using Get package?

I want to change the default animation of page transition to fade transition when I go to a new route using get package, Currently I am using this command to navigate : Get.offAllNamed(HomeScreen.routeName);, this clears my route stack and takes me to the new page using default transition.

Is there a way I can change that animation to fading animation using Get package?

Upvotes: 0

Views: 826

Answers (1)

dokind
dokind

Reputation: 323

I found a kind of transaction.

 Get.to(() => const RegisterView(),
                              transition: Transition.downToUp);

Transition is enum you can give any of this and they're different animations. fade, fadeIn, rightToLeft, leftToRight, upToDown, downToUp, rightToLeftWithFade, leftToRightWithFade, zoom, topLevel, noTransition, cupertino and so on...

Upvotes: 1

Related Questions