admin管理员组

文章数量:1123598

I'm using Rive in my Flutter app for animations. I have a main artboard with a nested artboard called "mouth." I want to access the inputs (hear and sad) from both artboards, but I'm having trouble with the nested artboard's inputs.

Here’s my code:

RiveAnimation.asset(
  RiveAsset.RG,
  artboard: 'Artboard',
  fit: BoxFit.contain,
  onInit: onRiveInit,
);

SMIInput<bool>? hearInput;
SMIInput<bool>? sadInput;

void onRiveInit(Artboard artboard) {
  final controller = StateMachineController.fromArtboard(
    artboard,
    'main',
  );
  if (controller != null) {
    artboard.addController(controller);
    hearInput = controller.findInput<bool>('hear'); // Input from the main artboard
    sadInput = controller.findInput<bool>('sad'); // Input from the nested artboard
  }
}

The issue is that while hearInput (from the main artboard) works correctly, sadInput (from the nested artboard) does not work with the findInput method. How can I access inputs from a nested artboard in Rive?

本文标签: How do I call the inputs of nested artboard 39mouth39 used in my main artboard in flutterStack Overflow