fromArtboard method Null safety
Instance a StateMachineController from an artboard
with the given
stateMachineName
. Returns the StateMachineController or null if no
StateMachine with stateMachineName
is found.
Implementation
static StateMachineController? fromArtboard(
Artboard artboard,
String stateMachineName, {
core.OnStateChange? onStateChange,
}) {
for (final animation in artboard.animations) {
if (animation is StateMachine && animation.name == stateMachineName) {
return StateMachineController(animation, onStateChange: onStateChange);
}
}
return null;
}