MultiTrackTween class

Animatable that tweens multiple parallel properties (called Tracks).

The constructor of MultiTrackTween expects a list of Track objects. You can fetch the specified total duration via duration getter.

Example:

  final tween = MultiTrackTween([
    Track("color")
      .add(Duration(seconds: 1), ColorTween(begin: Colors.red, end: Colors.blue))
      .add(Duration(seconds: 1), ColorTween(begin: Colors.blue, end: Colors.yellow)),
    Track("width")
      .add(Duration(milliseconds: 500), ConstantTween(200.0))
      .add(Duration(milliseconds: 1500), Tween(begin: 200.0, end: 400.0),
           curve: Curves.easeIn)
  ]);

  return ControlledAnimation(
    duration: tween.duration,
    tween: tween,
    builder: (context, values) {
       ...
    }
  );
Inheritance
Annotations
  • @Deprecated('See migration guide: https://pub.dev/packages/sa_v1_migration')

Constructors

MultiTrackTween(List<Track> tracks)

Properties

duration Duration
Returns the highest duration specified by Tracks. [...]
read-only
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

animate(Animation<double> parent) Animation<Map<String, dynamic>>
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<Map<String, dynamic>>
Returns a new Animatable whose value is determined by first evaluating the given parent and then evaluating this object. [...]
inherited
evaluate(Animation<double> animation) Map<String, dynamic>
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
A string representation of this object. [...]
inherited
transform(double t) Map<String, dynamic>
Computes the map of specific values for the animation. You don't need to call it yourself. It's been implicitly used by Tween-consuming classes. [...]
override

Operators

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