- *Timer is unrelated to Flutter, and is just a timer like you’d fine in any other language.
- On the other hand, AnimationController (and
Ticker
, its equivalent ofTimer
) is Flutter specific. - The difference with a
Timer
is that, by usingAnimationController
, the “ticker” can be muted, slowed, or mocked.
As such, using AnimationController
we have a few benefits:
- if the associated widget isn’t visible, the animation is paused (that’s what that
vsync
arg is used for) - we get access to a “slow animations” devtool which makes the seconds slower for animations only
- tests can “mock” these timers. As such, if an animation last 3 seconds, a test can simulate the entire animation without having to actually wait for 3 seconds.