evaluate method

  1. @override
EvaluatedRootVectorAnimationProperties evaluate(
  1. double progress,
  2. Duration animationDuration, {
  3. double? defaultAlpha,
})

Evaluate the various sequences and collapse them to a single value based on the progress passed in. The return value is a Record that contains each field resolved value.

Usually subclasses will have a list of optional named parameters for this method that allows to pass in default values for each sequence as they could potentially collapse to null values. If default values are passed in usually the user expects said field to be non null.

The parameter animationDuration is the duration from the source AnimatedVectorData.

It would be useful for implementers to refer to builtin properties subclasses implementations like PathAnimationProperties.evaluate and EvaluatedPathAnimationProperties.

Implementation

@override
EvaluatedRootVectorAnimationProperties evaluate(
  double progress,
  Duration animationDuration, {
  double? defaultAlpha,
}) {
  ensureIntervalsAreValid();
  final evaluator = AnimationPropertyEvaluator(animationDuration, progress);

  return (alpha: evaluator.evaluate(alpha, defaultAlpha),);
}