Home > Back-end >  Add transition/animation between conditional statement view switch
Add transition/animation between conditional statement view switch

Time:01-03

I have a conditional statement to render two different views based on the state. However, when the state changes the view just blinks in with white flash, are there any ways to make it look nicer, like a slower tranistion or any other kind of animations?

   body: children: [
              context.watch<ItemProvider>().hasItem
                  ? MyView()
                  : MyOtherView(),
...

CodePudding user response:

AnimatedSwitcher is the best option for you. You can learn more from this medium article

  • Related