Can't Get Data Binds Working In Flutter
I am trying to get a basic animation be interactable and movable using data binds in the new Rive release in flutter but I can’t seem to get it working. I have been trying to follow the examples here.
https://rive.app/docs/runtimes/data-binding#flutter
I have also been looking at the API documentation here.
https://pub.dev/documentation/rive/latest/rive/
But when I go to implement the example, the functions don’t even exist that the example is using.
I am using rive 0.13.20 and rive_native 0.0.1-dev.8
I am using pub get to get these packages but I can’t even import rive_native properly.
After following the examples and them not working, I tried to access data binds doing this way and I was able to load the artboard but there was no information available with the artboard either
// Initialize RiveFile before importing
await RiveFile.initialize();
// Load the Rive file
final file = await RiveFile.asset(
'assets/mimic.riv',
);
// Get the artboard
final artboard = file.mainArtboard;
final stateMachine = artboard.stateMachines.first;
print("Artboard: ${artboard.name}");
print("Global Databinds: ${artboard.globalDataBinds}");
print("ViewModel: ${artboard.instance().viewModelInstance?.name}");
print("Databinds: ${artboard.instance().dataBinds}");I do have the Data and view models setup, they are also bound to where they need to be and the model is selected in the artboard model property as well.
When I play the state machine, the animations work as expected when I modify these data bind values individually. My team and I were looking to purchase this tool but with how difficult its been to even get a basic data bind example going, we aren’t sure anymore