Implicit Flutter Animations

Oct 4 2022 · Dart 2.17, Flutter 3.0, Visual Studio Code 1.7

Part 2: Implicit Animations in Action

09. Animate an Item Switcher

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: 08. Create a Multi-Selection Animation Next episode: 10. Animate the Item Switcher's Selector

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.

Notes: 09. Animate an Item Switcher

The student materials have been reviewed and are updated as of August 2022.

The updated material uses null safety and also deploys the use coding practises encouraged by the Flutter as per the Flutter lint rules and a few addons of practises that are considered good here at raywenderlich (see analysis_options.yaml in the material for more info).

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Let’s move over to the meals section of the home page. In here, we have a simple meal switcher that updates the meals list based on the item selected. Currently it doesnt have any animation. Let’s head over to the code to get a brief overview of what it does.

AnimatedSwitcher(
    duration: const Duration(milliseconds: 450),
    child: MealsList(meals: _meals),
),
child: MealsList(
    key: ValueKey(_currentSelection),
    meals: _meals,
),
transitionBuilder: (Widget child, Animation<double> animation) {
    return ScaleTransition(child: child, scale: animation);
    //return RotationTransition(child: child, turns: animation); -->
},