Skip to content

How can I implement onStateChange in StateMachineController.fromArtboard when migrate from 0.13.x to 0.14.x? #559

@luu-elfie

Description

@luu-elfie

I'm going through the document for version 0.14.x but not find any migration code for onStateChange from StateMachineController.fromArtboard:

    final controller = StateMachineController.fromArtboard(
      artboard,
     "stateMachineName",
      onStateChange: (String stateMachineName, String stateName ) {
          // How can I listen to stateName change here?
      },
    );

Can anyone help me solve this?

Moreover, is there any equivalent solution to define a list of animation in 0.14.x like in 0.13.x:

      RiveAnimation.asset(
        AppAssets.RIVE_HELP_AND_SUPPORT_ROBOT,
        animations: ['headphoneOn', '0.Clear'], // I want to perform a set of animation here
        fit: BoxFit.contain,
      );

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions