TrainHoppingAnimation class
This animation starts by proxying one animation, but when the value of that animation crosses the value of the second (either because the second is going in the opposite direction, or because the one overtakes the other), the animation hops over to proxying the second animation.
When the TrainHoppingAnimation starts proxying the second animation instead of the first, the onSwitchedTrain callback is called.
If the two animations start at the same value, then the TrainHoppingAnimation immediately hops to the second animation, and the onSwitchedTrain callback is not called. If only one animation is provided (i.e. if the second is null), then the TrainHoppingAnimation just proxies the first animation.
Since this object must track the two animations even when it has no listeners of its own, instead of shutting down when all its listeners are removed, it exposes a dispose() method. Call this method to shut this object down.
- Inheritance
- Object
- Listenable
- Animation<
double> - TrainHoppingAnimation
- Mixed in types
Constructors
-
TrainHoppingAnimation(Animation<
double> _currentTrain, Animation< double> _nextTrain, { VoidCallback onSwitchedTrain }) - Creates a train-hopping animation. [...]
Properties
-
currentTrain
→ Animation<
double> -
The animation that is currently driving this animation. [...]
read-only
- onSwitchedTrain ↔ VoidCallback
-
Called when this animation switches to be driven by the second animation. [...]
read / write
- status → AnimationStatus
-
The current status of this animation.
read-only, override
- value → double
-
The current value of the animation.
read-only, override
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- isCompleted → bool
-
Whether this animation is stopped at the end.
read-only, inherited
- isDismissed → bool
-
Whether this animation is stopped at the beginning.
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
dispose(
) → void -
Frees all the resources used by this performance.
After this is called, this object is no longer usable.
override
-
toString(
) → String -
Returns a string representation of this object.
override
-
addListener(
VoidCallback listener) → void -
Calls the listener every time the value of the animation changes. [...]
inherited
-
addStatusListener(
AnimationStatusListener listener) → void -
Calls listener every time the status of the animation changes. [...]
inherited
-
didRegisterListener(
) → void -
This implementation ignores listener registrations.
inherited
-
didUnregisterListener(
) → void -
This implementation ignores listener registrations.
inherited
-
drive<
U>( Animatable< U> child) → Animation< U> -
Chains a Tween (or CurveTween) to this Animation. [...]
@optionalTypeArgs, inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
notifyListeners(
) → void -
Calls all the listeners. [...]
inherited
-
notifyStatusListeners(
AnimationStatus status) → void -
Calls all the status listeners. [...]
inherited
-
removeListener(
VoidCallback listener) → void -
Stop calling the listener every time the value of the animation changes. [...]
inherited
-
removeStatusListener(
AnimationStatusListener listener) → void -
Stops calling the listener every time the status of the animation changes. [...]
inherited
-
toStringDetails(
) → String -
Provides a string describing the status of this object, but not including
information about the object itself. [...]
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited