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.

This example defines an animation that uses an easing curve to interpolate between 5.0 and 10.0 during the first 40% of the animation, remains at 10.0 for the next 20%, and then returns to 5.0 for the final 40%.
link
final Animation<double> animation = TweenSequence<double>(
  <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
Implementers

Constructors

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

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
transform(double t) → T
Returns the value of the object at point t.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited