Implicit Flutter Animations

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

Part 1: Animation Fundamentals

3. Add Realistic Motions with Curves

Episode complete

Play next episode

Next
Save for later
About this episode
See versions
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 2. Understand Implicit Animations Next episode: 4. Create Custom Implicit Animations

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

The updated material uses null safety and also deploys the use of const keyword with constant constructors as per the Flutter lint rules that is used to encourage good coding practises.

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

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

Let’s take a look at this animation: If you notice, the slide animation animates linearly. Which means it increases at a steady rate and does not really mimic a real world movement.

AnimatedPositioned(
    ...
    curve: Curves.bounceOut
    ...
)
AnimatedPositioned(
    ...
    curve: Curves.easeIn
    ...
)
AnimatedPositioned(
    ...
    curve: Curves.easeInOutQuint
    ...
)
...
bool _showBox = false;
...
body: Center(
    child: AnimatedContainer(
        duration: const Duration(milliseconds: 1000),
        curve: Curves.bounceOut,
        width: _showBox ? 200 : 100,
        height: _showBox ? 200 : 100,
        color: _showBox ? Colors.orange : Colors.green,
    ),
)

[Browser Window] Curves Page

Here you have different curves. Playing them shows how the animation progresses from 0.0 to 1.0 lifespan of an animation. By the side, you have a visual feel of how each curve affects different animation effects.