SimpleAnimation class Null safety

A simple RiveAnimationController that plays back a LinearAnimation defined by an artist. All playback parameters (looping, speed, keyframes) are artist defined in the Rive editor. This takes a declaritive approach of using an animationName as the only requirement for resolving the animation. When the controller is added to an artboard (note that due to widget lifecycles it could get re-initialized on another artboard later) it'll look for the animation. Not finding the animation is a condition this example deals with by simply nulling the AnimationInstance _instance which means it won't be applied during advance cycles. Another approach would be let this throw, but this one is a little more forgiving which can be desireable with files dynamically loaded (downloaded even) at runtime.

Inheritance
Implementers

Constructors

SimpleAnimation(String animationName, {double mix = 1, bool autoplay = true})

Properties

animationName String
Animation name
final
autoplay bool
Pauses the animation when it's created
final
hashCode int
The hash code for this object. [...]
read-only, inherited
instance LinearAnimationInstance?
read-only
isActive bool
read / write, inherited
isActiveChanged ValueListenable<bool>
read-only, inherited
mix double
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

apply(RuntimeArtboard artboard, double elapsedSeconds) → void
Apply animation to objects registered in core. Note that a core context is specified as animations can be applied to instances.
override
dispose() → void
inherited
init(RuntimeArtboard artboard) bool
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onActivate() → void
@protected, inherited
onDeactivate() → void
@protected, inherited
reset() → void
Resets the animation back to it's starting time position
toString() String
A string representation of this object. [...]
inherited

Operators

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