📱 Flutter
Intermediate
What is a Tween in Flutter?
Answer
A Tween (short for in-between) defines how to interpolate between a begin and end value over the course of an animation. It maps the animation controller's 0.0–1.0 range to the actual value range. For example, Tween<double>(begin: 0, end: 300) produces values from 0 to 300 as the animation progresses. Tweens exist for many types: ColorTween, SizeTween, RectTween. You animate a Tween by calling tween.animate(controller) to get an Animation<T>.