tween method

Observable<double> tween (double startValue, double changeInTime, Duration duration, { int intervalMs: 16, Ease ease: Ease.LINEAR })

Creates an Observable that emits values starting from startValue and incrementing according to the ease type over the duration.

This function is generally useful for transitions, such as animating items across a screen or muting the volume of a sound gracefully.

Example

Observable
  .tween(0.0, 100.0, const Duration(seconds: 1), ease: Ease.IN)
  .listen((i) => view.setLeft(i)); // Imaginary API as an example

Implementation

static Observable<double> tween(
        double startValue, double changeInTime, Duration duration,
        {int intervalMs: 16, Ease ease: Ease.LINEAR}) =>
    new Observable<double>(new TweenStream(
        startValue, changeInTime, duration, intervalMs, ease));