2d-inc/Flare-Flutter

Expose option to configure package for FlareActor

IchordeDionysos opened this issue · 4 comments

We should be able to set the package of an asset.

We are able to do this, for built-in Widgets, like (Image.asset) and external libraries, like (SvgPicture.asset).

We should also be able to use it for Flare.

Due to our usage of Add-to-App and custom test runner for the Flutter part, we have to load the assets from a package and can't load them from the app's assets.

The package parameter is only a convenience function (see frame, AssetImage as an example). This means that the following two setups are equal:

Image.asset(
  'assets/image.png',
  package: 'some_package',
)
// same as:
Image.asset(
  'packages/some_package/assets/image.png',
)

Thus, you can do the following:

FlareActor(
  'packages/some_package/assets/animation.flr',
)

At least, until #246 is merged.

🙃

Any update on this?

@littleGnAl You can use a Git dependency with ref d7311fa5d885aa091f5da7cb8a4e2372eb1deb08 for now.