MultiTween<P> class
Animatable that animates multiple properties at once. It can also chain multiples Tweens for a property.
Example: (using supercharged)
// Define your animation properties somewhere
enum AniProps { width, height, color }
// Create MultiTween based on your enum
final tween = MultiTween<AniProps>()
..add(AniProps.width, 0.0.tweenTo(100.0), 1000.milliseconds)
..add(AniProps.width, 100.0.tweenTo(200.0), 500.milliseconds)
..add(AniProps.height, 0.0.tweenTo(200.0), 2500.milliseconds)
..add(AniProps.color, Colors.red.tweenTo(Colors.blue), 3.seconds);
For details on the add
method: MultiTween.add.
If you don't want to define your own enum, you can use DefaultAnimationProperties that comes with MultiTween.
- Inheritance
-
- Object
- Animatable<
MultiTweenValues< P> > - MultiTween
Constructors
Properties
Methods
-
add(
P property, Animatable tween, [Duration duration = const Duration(seconds: 1), Curve curve = Curves.linear]) → void -
Adds a new tweening task for a specified
property
. -
animate(
Animation< double> parent) → Animation<MultiTweenValues< P> > -
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<MultiTweenValues< P> > -
Returns a new Animatable whose value is determined by first evaluating
the given parent and then evaluating this object at the result.
inherited
-
evaluate(
Animation< double> animation) → MultiTweenValues<P> -
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.
inherited
-
transform(
double t) → MultiTweenValues< P> -
Returns a MultiTweenValues that is used to get the animated values.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited