Closed lionoggo closed 3 years ago
If we use Flare animation in the flutter-plugin project, an exception will be thrown that the resource failed to load, as shown below:
E/flutter (15211): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Unable to load asset: assets/Filip.flr E/flutter (15211): #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:229:7) E/flutter (15211): <asynchronous suspension> E/flutter (15211): #1 FlareCacheAsset.load (package:flare_flutter/flare_cache_asset.dart:18:20) E/flutter (15211): #2 Cache.getAsset (package:flare_flutter/cache.dart:55:15) E/flutter (15211): <asynchronous suspension>
The root cause of the problem is: no package name is specified for the resource.We solve this problem by specifying a package name for the resource, as shown below:
FlareActor( "assets/Filip.flr", alignment: Alignment.center, fit: BoxFit.contain, animation: _animationName, package: 'simple_plugin', );
At the same time, I also added a new demo project:simple-plugin.
It's great.
FlareActor( "packages/pluginname/assets/Filip.flr", alignment: Alignment.center, fit: BoxFit.contain, animation: _animationName,
);
it's ok
If we use Flare animation in the flutter-plugin project, an exception will be thrown that the resource failed to load, as shown below:
The root cause of the problem is: no package name is specified for the resource.We solve this problem by specifying a package name for the resource, as shown below:
At the same time, I also added a new demo project:simple-plugin.