I’m working through a nine-lesson path on Flutter animations, from implicit widgets up to physics, CustomPainter, and Rive/Lottie. Each lesson has a few core ideas, one runnable example, and three exercises that get harder. I’m going one lesson per sitting and not moving on until the exercises are done.
My Daily Tarot onboarding screen already uses staggered animations, so part of the goal is to understand properly what I hacked together there.
Rule of thumb for the whole course
Reach for the simplest tool that works: an implicit widget first, then a
TweenAnimationBuilder, and only then anAnimationController.
🗺️ Roadmap
- 1. Implicit animations: animate any property change with one widget swap (
AnimatedContainer,AnimatedOpacity,AnimatedSwitcher,TweenAnimationBuilder) ⬅️ in progress - 2. Controllers, tweens and curves: start, stop, reverse and repeat an animation yourself (
AnimationController,Tween,CurvedAnimation,TickerProviderStateMixin) - 3. Explicit transitions: ready-made transition widgets driven by your own controller (
FadeTransition,SlideTransition,ScaleTransition,RotationTransition) - 4. AnimatedBuilder and AnimatedWidget: animate anything without rebuilding the whole tree (the
childoptimisation) - 5. Hero and page transitions: fly a widget between screens and build custom routes (
Hero,PageRouteBuilder, theanimationspackage) - 6. Staggered animations: choreograph several parts on one timeline (
Interval,TweenSequence) - 7. Physics and gestures: fling, snap and spring like real objects (
SpringSimulation,animateWith,GestureDetector) - 8. CustomPainter: draw and animate your own shapes, paths and charts (
Canvas,Path,repaint:) - 9. Rive and Lottie: drop in designer-made animations and control them from code
- Capstone: rebuild an animation I admire from a real app
🔬 Lesson 1 exercises
- Feel the curves: swap in
elasticOut,bounceOutandeaseOutBack, and move the box withAnimatedAlign - Like button: heart icon swap with
AnimatedSwitcher, plus a 1.3x pop withAnimatedScaleandonEnd - Animated progress: one
TweenAnimationBuilder<double>drives both a progress ring and a counting percentage label
🛠️ Setup
- A scratch app (
flutter create anim_lab), pasting each example overlib/main.dart, or just DartPad. timeDilation = 5.0;(frompackage:flutter/scheduler.dart) at the top ofmain()to slow everything down and see what’s really happening.
I’ll tick things off here as I go.