Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Component for the onInit callback does not have a name. #428

Closed
xSILENCEx opened this issue Oct 21, 2024 · 1 comment
Closed

The Component for the onInit callback does not have a name. #428

xSILENCEx opened this issue Oct 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xSILENCEx
Copy link

Description

The Component for the onInit callback does not have a name.

Steps To Reproduce

Steps to reproduce the behavior:

SizedBox(
  width: 200,
  height: 200,
  child: RiveAnimation.asset(
    'assets/rive/test3.riv',
    artboard: 'Artboard',
    animations: const ['Timeline 1'],
    onInit: (artboard) {
      artboard.forEachComponent(
        (child) {
          print(child.toString());
        },
      );
    },
  ),
),

No name in the output:

flutter: Instance of 'Shape' (1) ->
flutter: Instance of 'Rectangle' (2) ->
flutter: Instance of 'SolidColor' (3) ->
flutter: Instance of 'LayoutComponentStyle' (4) ->
flutter: Instance of 'SolidColor' (5) ->
flutter: Instance of 'Fill' (6) ->
flutter: Instance of 'Fill' (7) ->

Source .riv/.rev file

test3.riv.zip

Expected behavior

flutter: Instance of 'Shape' (1) -> name
flutter: Instance of 'Rectangle' (2) -> name
flutter: Instance of 'SolidColor' (3) -> name
flutter: Instance of 'LayoutComponentStyle' (4) -> name
flutter: Instance of 'SolidColor' (5) -> name
flutter: Instance of 'Fill' (6) -> name
flutter: Instance of 'Fill' (7) -> name

Screenshots

iShot_2024-10-21_16 06 30

Device & Versions (please complete the following information)

  • Device: [iPhone11 ,MacOS]
  • OS: [iOS 17.6.1, MacOS 15.0.1]
  • Flutter Version: Copy-paste the output of flutter --version
Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2663184aa7 (6 weeks ago) • 2024-09-11 16:27:48 -0500
Engine • revision 36335019a8
Tools • Dart 3.5.3 • DevTools 2.37.3
@xSILENCEx xSILENCEx added the bug Something isn't working label Oct 21, 2024
@HayesGordon
Copy link
Contributor

@xSILENCEx this is a recent optimization that the editor now does, to not export names unless set to export. This reduces the overall .riv file size.

See our docs here to enable a name to be exported: https://rive.app/community/doc/exporting-for-runtime/docp8HLoCk3G#changes-to-exporting-object-names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants