TransitionFunction typedef

num TransitionFunction (
  1. num ratio

The TransitionFunction is the function signature for transitions used in the Tween and Translation classes. The function takes the ratio between 0.0 and 1.0 and returns the actual progress of the transition.

See also: Transition, Tween, Translation


// a linear transition
TransitionFunction transition = (ratio) => ratio;

// a quadratic transition
TransitionFunction transition = (ratio) => ratio * ratio;


typedef TransitionFunction = num Function(num ratio);