Material Transitions in Flutter with the Animations Package

Sep 21 2021 · Dart 2.13, Flutter, VS Code 1.59

Part 1: Material Transitions in Flutter with the Animations Package

05. Animate Screens with the SharedAxis Animation

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 04. Work with Fade Transitions Next episode: 06. Create Custom Route Animations

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

The final transition provided by the animations library is the shared axis transition. It transitions elements based on the horizotal, vertical or the Z axis with a fade animation. Let’s replace the FadeScaleTransition in the main_page.dart file with it. Update your code to the following:

return SharedAxisTransition(
    child: child,
    animation: primaryAnimation,
    secondaryAnimation: secondaryAnimation,
    transitionType: SharedAxisTransitionType.horizontal,
);
...
transitionType: SharedAxisTransitionType.vertical,
...
...
transitionType: SharedAxisTransitionType.scaled,
...
reverse: _selectedIndex == 0,