-
Notifications
You must be signed in to change notification settings - Fork 222
Closed
Description
Description:
It seems that there is no way to get a callback for the end of a state in the state machine in rive_native. In the rive_common version, I can obtain the callback using the following code:
// get animation controller
_riveController = StateMachineController.fromArtboard(
artBoard,
"animation_default",
onStateChange: _onStateChange,
);
// listen the animation state
void _onStateChange(String stateMachineName, String stateName) {
if (stateName == "ExitState" &&
stateMachineController?.layerControllers.length == 1) {
animationEnd?.call(stateName);
return;
}
if (lastAnimationState != stateName) {
if (lastAnimationState.isNotEmpty) {
animationEnd?.call(lastAnimationState);
}
lastAnimationState = stateName;
}
animationBegin?.call(stateName);
}However, this functionality is missing in rive_native. Is there any alternative way to achieve this in rive_native?
Metadata
Metadata
Assignees
Labels
No labels