Skip to main content
N
15d ago

How to update the Nested Input in flutter?

Hi,

I tried to add nested input in Flutter by using artboard.getBoolInput(name, path). It worked at the beginning when I printed the input value. It displayed false as the default setting.

i.e. _btnInput = artboard.getBoolInput(name, path)

However, when I tried to tap on the bolean button, the animation shows but the input value kept in false. I referenced to my rive statemachine, the input value should change to false after tapping.

In Flutter, I also tried to change the input value by entering (_btnInput?.value == true;), the input value kept in false.

Does anyone know how to update the nested input value in Flutter?

Thanks.

4 replies
N
14d ago

Would you mind sharing your code and your .rev file so I can take a closer look? If you don't want to share it here, you can create a ticket here.

N
14d ago

I attached the related Rive images and Flutter codes. Animations work well in Rive and Flutter but I cannot change the value of the input in Flutter after tapping play button

(edited) 12d ago

In this scenario it might be better to use events, rather than inputs. Inputs are best for communicating from your code to Rive and events are best when you want to communicate from Rive to your code.

Here's an overview showing how to create an event in Rive: https://rive.app/community/doc/overview/docREl0GMIeb

Here's how you listen for events in Flutter: https://rive.app/community/doc/rive-events/docbOnaeffgr

N
12d ago

Understood. Thanks for your advice :)