2d-inc / Flare-Flutter

Load and get full control of your Rive files in a Flutter project using this library.
https://rive.app/
MIT License
2.55k stars 470 forks source link

Expose option to configure package for FlareActor #245

Open IchordeDionysos opened 4 years ago

IchordeDionysos commented 4 years ago

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.

creativecreatorormaybenot commented 4 years ago

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.

🙃

littleGnAl commented 4 years ago

Any update on this?

creativecreatorormaybenot commented 4 years ago

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

littleGnAl commented 4 years ago

@creativecreatorormaybenot Thanks!