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 = Curves.easeInOut;
return {
"translateX": TweenList<double>(
[
TweenPercentage(percent: 0, value: 0.0, curve: curve),
TweenPercentage(
percent: 13, value: -6.0 * preferences.magnitude, curve: curve),
TweenPercentage(
percent: 37, value: 5.0 * preferences.magnitude, curve: curve),
TweenPercentage(
percent: 63, value: -3.0 * preferences.magnitude, curve: curve),
TweenPercentage(
percent: 87, value: 2.0 * preferences.magnitude, curve: curve),
TweenPercentage(percent: 100, value: 0.0, curve: curve),
],
),
"rotateY": TweenList<double>(
[
TweenPercentage(percent: 0, value: 0.0, curve: curve),
TweenPercentage(
percent: 13,
value: -9.0 * toRad * preferences.magnitude,
curve: curve),
TweenPercentage(
percent: 37,
value: 7.0 * toRad * preferences.magnitude,
curve: curve),
TweenPercentage(
percent: 63,
value: -5.0 * toRad * preferences.magnitude,
curve: curve),
TweenPercentage(
percent: 87,
value: 3.0 * toRad * preferences.magnitude,
curve: curve),
TweenPercentage(percent: 100, value: 0.0, curve: curve),
],
),
};
}