StateMachine class abstract
A Rive state machine that drives animations based on inputs and logic.
State machines provide interactive control over animations. Obtain via Artboard.stateMachine, Artboard.stateMachineAt, or Artboard.defaultStateMachine.
- Implemented types
Constructors
Properties
- boundRuntimeViewModelInstance → ViewModelInstance?
-
The view model instance that is bound to the state machine.
no setter
- eventListenerCount → int
-
The number of registered event listeners.
no setterinherited
- focusManager → FocusManager?
-
Get the focus manager for this state machine.
Returns the active focus manager (external if set, internal otherwise).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inputs
→ List<
Input> -
Returns a list of all inputs in the state machine.
no setter
- name → String
-
The name of this state machine.
no setter
- numberOfAdvanceRequestListeners → int
-
The number of registered advance request listeners.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAdvanceRequestListener(
VoidCallback callback) → void -
Adds a listener to be notified when advance is requested.
inherited
-
addEventListener(
OnRiveEvent callback) → void -
Adds a listener to receive Rive events.
inherited
-
advance(
double elapsedSeconds, bool newFrame) → bool -
Advances the state machine by
elapsedSeconds. -
advanceAndApply(
double elapsedSeconds) → bool - Advances the state machine and applies changes to the artboard.
-
bindViewModelInstance(
ViewModelInstance viewModelInstance) → void -
Binds the provided
viewModelInstanceto the state machine -
boolean(
String name, {String? path}) → BooleanInput? -
Retrieve a boolean input from the state machine with the given
name. Get/set the BooleanInput.value of the input. -
dispose(
) → void - Releases resources associated with this state machine.
-
dragEnd(
Vec2D position, {double? timeStamp}) → HitResult -
Notifies the state machine of a drag end event at
position. -
dragStart(
Vec2D position, {double? timeStamp}) → HitResult -
Notifies the state machine of a drag start event at
position. -
fireSemanticAction(
int semanticNodeId, SemanticActionType actionType) → void -
Fires a semantic action on the semantic node with the given
semanticNodeId. -
hitTest(
Vec2D position) → bool -
Tests if the given
positionhits any interactive element. -
inputAt(
int index) → Input? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
number(
String name, {String? path}) → NumberInput? -
Retrieve a number input from the state machine with the given
name. Get/set the NumberInput.value of the input. -
pointerDown(
Vec2D position, {int pointerId = 0}) → HitResult -
Notifies the state machine of a pointer down event at
position. -
pointerExit(
Vec2D position, {int pointerId = 0}) → HitResult -
Notifies the state machine that the pointer exited at
position. -
pointerMove(
Vec2D position, {double? timeStamp, int pointerId = 0}) → HitResult -
Notifies the state machine of a pointer move event at
position. -
pointerUp(
Vec2D position, {int pointerId = 0}) → HitResult -
Notifies the state machine of a pointer up event at
position. -
removeAdvanceRequestListener(
VoidCallback callback) → void -
Removes a previously added advance request listener.
inherited
-
removeAllAdvanceRequestListeners(
) → void -
Removes all advance request listeners.
inherited
-
removeAllEventListeners(
) → void -
Removes all registered event listeners.
inherited
-
removeEventListener(
OnRiveEvent callback) → void -
Removes a previously added event listener.
inherited
-
reportedEvents(
) → List< Event> - Returns a list of events that have been reported by the state machine.
-
requestAdvance(
) → void -
Notifies all listeners that an advance/repaint is needed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
trigger(
String name, {String? path}) → TriggerInput? -
Retrieve a trigger input from the state machine with the given
name. Trigger the input by calling TriggerInput.fire.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited