Flare-Flutter
Flare-Flutter copied to clipboard
Specifying package string
Image.asset allows to specify the package string, this is nessecary when writing a package and using the asset in a widget of the package. Without this information an error will be thrown when trying to retrieve the asset.
A similiar parameter is needed to use an asset in the same fashion with flareflutter
Example with the Image widget:
Image.asset(
AssetImage("assets/img/supergraphic.png").assetName,
package: 'flutter_ui_components',
fit: BoxFit.fitWidth,
),
Recreation of the situation:
- Create plugin flutter create --org com.example --template=plugin hello
- Write Widget with FlareActor in the dart portion of the plugin
- Try to use the widget in the example flutter app of the plugin
We'll expose both the package name and the bundle to use soon. In the meantime, could you try to see if this unblocks you: specify the .flr file's name with a preceding package path ("packages/" + packageName + "/" + flareFile):
FlareActor("packages/flutter_ui_components/assets/my_flare_file.flr")
That solution worked for me