TweenSequence<T> class

Enables creating an Animation whose value is defined by a sequence of Tweens.

Each TweenSequenceItem has a weight that defines its percentage of the animation's duration. Each tween defines the animation's value during the interval indicated by its weight.

For example, to define an animation that uses an easing curve to interpolate between 5.0 and 10.0 during the first 40% of the animation, remain at 10.0 for the next 20%, and then return to 10.0 for the final 40%:

final Animation<double> = TweenSequence(
  <TweenSequenceItem<double>>[
    TweenSequenceItem<double>(
      tween: Tween<double>(begin: 5.0, end: 10.0)
        .chain(CurveTween(curve: Curves.ease)),
      weight: 40.0,
    ),
    TweenSequenceItem<double>(
      tween: ConstantTween<double>(10.0),
      weight: 20.0,
    ),
    TweenSequenceItem<double>(
      tween: Tween<double>(begin: 10.0, end: 5.0)
        .chain(CurveTween(curve: Curves.ease)),
      weight: 40.0,
    ),
  ],
).animate(myAnimationController);
Inheritance

Constructors

TweenSequence(List<TweenSequenceItem<T>> items)
Construct a TweenSequence. [...]

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

transform(double t) → T
Returns the value of the object at point t. [...]
animate(Animation<double> parent) Animation<T>
Returns a new Animation that is driven by the given animation but that takes on values determined by this object. [...]
inherited
chain(Animatable<double> parent) Animatable<T>
Returns a new Animatable whose value is determined by first evaluating the given parent and then evaluating this object. [...]
inherited
evaluate(Animation<double> animation) → T
The current value of this object for the given Animation. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited