Flutter web unable to load assets from packages

Viewed 228

I'm testing flutter web for one of my web app.

I've noticed that if I use a package that has some preloaded assets to be displayed, the web app will say that it is unable to load assets.

I tried with these packages:

 1. flutter_country_picker
 2. cool_alert

The error that I get is:

Error while trying to load an asset: Failed to load asset at "assets/packages/cool_alert/assets/flare/success_check.flr" (404)

I've read that the problems depends on the fact that flutter web uses another way to get the assets.

Is there a way to solve address this problem?

1 Answers

I've had a look at those packages, and it's actually the packages themselves:

pubspec.yaml

assets:
  - assets/flare/

Packages should be calling in asset's differently to avoid this error:

assets:
  - packages/cool_alert/assets/flare/

I would recommend either raising an issue or create a PR with the package authors.

Related