resolveDefinition method

void resolveDefinition({
  1. Size? widgetSize,
  2. Size? screenSize,
})

Resolves the AnimationDefinition, creates a controller and sets offset and duration from the passed in AnimationPreferences. If needsWidgetSize and/or needsScreenSize are true inside the definition these will be passed to the AnimationDefinition

Implementation

void resolveDefinition({Size? widgetSize, Size? screenSize}) {
  _sequence = _definition.getDefinition(
    widgetSize: widgetSize,
    screenSize: screenSize,
  );

  _controller = AnimationController(
    duration:
        _definition.preferences.offset + _definition.preferences.duration,
    vsync: vsync,
  );

  _sequence.values.forEach((value) {
    value.offset = _definition.preferences.offset;
    value.duration =
        _definition.preferences.offset + _definition.preferences.duration;
    value.animation = value.animate(_controller!);
  });

  if (_definition.preferences.animationStatusListener != null) {
    _controller!
        .addStatusListener(_definition.preferences.animationStatusListener!);
  }
}