addTranslation method Null safety

Translation addTranslation(
  1. num startValue,
  2. num targetValue,
  3. num time,
  4. TransitionFunction transition,
  5. void onUpdate(
    1. num value
    )
)

This is a convenience method that creates a Translation and adds it to this juggler. See Translation for more details.

Example:

// Animate the value from 0.0 to 100.0 within 5.0 seconds.
var transition = Transition.linear;
juggler.addTranslation(0.0, 100.0, 5.0, transition, (num value) {
  print(value);
});

Implementation

Translation addTranslation(num startValue, num targetValue, num time,
    TransitionFunction transition, void Function(num value) onUpdate) {
  final translation = Translation(startValue, targetValue, time, transition);
  translation.onUpdate = onUpdate;
  add(translation);
  return translation;
}