getDefinition method
AnimatorWidget calls getDefinition to gather the animation. Animations are defined using named TweenLists using a Map<String, TweenList>. Example: @override Map<String, TweenList> getDefinition({Size screenSize, Size widgetSize}) { return { "opacity": TweenList
Implementation
@override
Map<String, TweenList> getDefinition({Size? screenSize, Size? widgetSize}) {
final floorCurve = Cubic(0.215, 0.61, 0.355, 1);
final ceilCurve = Cubic(0.755, 0.05, 0.855, 0.06);
return {
"translateY": TweenList<double>(
[
TweenPercentage(percent: 0, value: 0.0, curve: floorCurve),
TweenPercentage(percent: 20, value: 0.0, curve: floorCurve),
TweenPercentage(
percent: 40,
value: -30.0 * preferences.magnitude,
curve: ceilCurve),
TweenPercentage(
percent: 43,
value: -30.0 * preferences.magnitude,
curve: ceilCurve),
TweenPercentage(percent: 53, value: 0.0, curve: floorCurve),
TweenPercentage(
percent: 70,
value: -15.0 * preferences.magnitude,
curve: ceilCurve),
TweenPercentage(percent: 80, value: 0.0, curve: floorCurve),
TweenPercentage(percent: 90, value: -4.0 * preferences.magnitude),
TweenPercentage(percent: 100, value: 0.0, curve: floorCurve),
],
),
};
}