getDefinition method

  1. @override
Map<String, TweenList> getDefinition({
  1. Size? screenSize,
  2. Size? widgetSize,
})
override

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}) {
  return {
    'opacity': TweenList<double>(
      [
        TweenPercentage(percent: 0, value: 0.0),
        TweenPercentage(percent: 54, value: 1.0),
      ],
    ),
    'translateZ': TweenList<double>(
      [
        TweenPercentage(percent: 0, value: 800.0 * preferences.magnitude),
        TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude),
        TweenPercentage(percent: 100, value: 0.0),
      ],
    ),
    'rotation': TweenList<double>(
      [
        TweenPercentage(
            percent: 0, value: 90.0 * toRad * preferences.magnitude),
        TweenPercentage(
            percent: 54, value: 87.0 * toRad * preferences.magnitude),
        TweenPercentage(percent: 100, value: 0.0),
      ],
    ),
  };
}