transform method

  1. @override
T transform(
  1. double t
)
override

Returns the value of the object at point t.

The value of t is nominally a fraction in the range 0.0 to 1.0, though in practice it may extend outside this range.

See also:

Implementation

@override
T transform(double t) {
  assert(t >= 0.0 && t <= 1.0);
  if (t == 1.0) {
    return _evaluateAt(t, _items.length - 1);
  }
  for (int index = 0; index < _items.length; index++) {
    if (_intervals[index].contains(t)) {
      return _evaluateAt(t, index);
    }
  }
  // Should be unreachable.
  throw StateError('TweenSequence.evaluate() could not find an interval for $t');
}