Accessing exported names of a nested component at runtime (Flutter 0.14.x)
Hi Rive community,
I've been working with the Flutter runtime (0.14.x) and ran into a limitation I wanted to share — and also ask if there's a known workaround.
The situation:
I have a main artboard (NeonRoom) that contains a nested component “artboard” (LCDDisplay). Inside LCDDisplay there's a text component called LCDText with its name exported in the Rive editor.
What I tried:
// From the main artboard — always returns null
ctrl.artboard.component('LCDText'); // null
// Via file-level artboard — returns an instance, but with template/static bounds
file.artboard('LCDDisplay')?.component('LCDText'); // non-null, but not what we want
// Via the nested artboard component on the main artboard
ctrl.artboard.component('LCDDisplay'); // non-null (FFIComponent)
// But cant access its exported names there is no methods for that. I have tried casting its pointer as an artboard and calling .component() didnt work too and crashes the app
Root cause (as I understand it):
In the C++ runtime, a NestedArtboard component pointer and the inner artboard pointer are separate objects. The Dart FFIComponent wraps the component pointer — there's no public API to get the live inner artboard pointer from it. So file.artboard('LCDDisplay') gives you the file-level template instance, not the live rendering instance attached to the main artboard's state machine.
Questions:
Is there an official way to get a live Artboard reference for a nested artboard at runtime in Flutter 0.14.x?
Is there a planned API for traversing the nested artboard tree from Dart?
Does artboard.component() intentionally only search the direct component list and not recurse into nested artboards?
Thanks — happy to share more details if needed!