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 curve = Cubic(0.215, 0.61, 0.355, 1);
return {
"opacity": TweenList<double>(
[
TweenPercentage(percent: 0, value: 0.0, curve: curve),
TweenPercentage(percent: 60, value: 1.0, curve: curve),
],
),
"translateY": TweenList<double>(
[
TweenPercentage(percent: 0, value: screenSize!.height, curve: curve),
TweenPercentage(
percent: 60, value: -25.0 * preferences.magnitude, curve: curve),
TweenPercentage(
percent: 75, value: 10.0 * preferences.magnitude, curve: curve),
TweenPercentage(
percent: 90, value: -5.0 * preferences.magnitude, curve: curve),
TweenPercentage(percent: 100, value: 0.0, curve: curve),
],
),
};
}