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

Specifying package string #171

Open
MSchmack opened this issue Oct 10, 2019 · 2 comments
Open

Specifying package string #171

MSchmack opened this issue Oct 10, 2019 · 2 comments
Assignees

Comments

@MSchmack
Copy link

MSchmack commented Oct 10, 2019

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:

  1. Create plugin
    flutter create --org com.example --template=plugin hello
  2. Write Widget with FlareActor in the dart portion of the plugin
  3. Try to use the widget in the example flutter app of the plugin
@luigi-rosso luigi-rosso self-assigned this Oct 16, 2019
@luigi-rosso
Copy link
Contributor

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")

@MSchmack
Copy link
Author

That solution worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants