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}) {
double multiplier = from == FlipInXOrigin.front ? -1.0 : 1.0;
if (alignment == Alignment.topCenter ||
alignment == Alignment.topLeft ||
alignment == Alignment.topRight) {
multiplier *= -1;
}
return {
"opacity": TweenList<double>(
[
TweenPercentage(percent: 0, value: 0.0, curve: Curves.easeIn),
TweenPercentage(percent: 60, value: 1.0),
],
),
"rotateX": TweenList<double>(
[
TweenPercentage(
percent: 0,
value: multiplier * 90.0 * toRad,
curve: Curves.easeIn),
TweenPercentage(
percent: 40,
value: multiplier * -20.0 * toRad,
curve: Curves.easeIn),
TweenPercentage(percent: 60, value: multiplier * 10.0 * toRad),
TweenPercentage(percent: 80, value: multiplier * -5.0 * toRad),
TweenPercentage(percent: 100, value: 0.0),
],
),
};
}