You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just updated my app from Flutter 1.x.x to 2.x.x and using flare_flutter 3.0.2.
Everything was working fine under Flutter 1.x.x, but since upgrading my code to work with 2.2.3, this is the only problem I'm experiencing in my app. The error output is:
I created a helper class for my Flare/Rive animations as below:
class Rive {
// Singleton
static final Rive _instance = new Rive.internal();
factory Rive() => _instance;
Rive.internal();
final Map<String, AssetFlare> _assets = {};
// Initialise the Flare assets.
Future<void> init() async {
animAsset.forEach((name, filename) {
_assets[name] = AssetFlare(bundle: rootBundle, name: filename);
});
// Don't prune the Flare cache, keep cached files ready to be re-displayed.
FlareCache.doesPrune = false;
await _cacheAssets();
}
// Play the named Flare animation asset.
Widget play({
@required String name,
@required String animation,
String artboard,
FlareController controller,
bool isPaused = false,
Alignment alignment = Alignment.center,
BoxFit fit = BoxFit.contain,
bool antialias = false,
void Function(String) callback,
}) {
return FlareActor.asset(_assets[name],
animation: animation,
artboard: artboard,
controller: controller,
isPaused: isPaused,
alignment: alignment,
fit: fit,
antialias: antialias,
callback: callback,
);
}
// Load all the Flare assets into the cache.
Future<void> _cacheAssets() async =>
_assets.forEach((name, asset) async => await cachedActor(asset));
// Load the specified Flare asset into the cache.
Future<void> cacheAsset(String name) async => await cachedActor(_assets[name]);
}
Basically, on initialisation, I cache the flare assets so they're all ready to be animated. Then call the play() function to run the animation.
This all used to work beautifully in the past. Now, with Flutter 2.x I'm getting the above error (even if I don't cache the files and attempt to play the files directly). It appears to be that _paint is not getting initialised in flare.dart.
Any pointers/help are most appreciated!
The text was updated successfully, but these errors were encountered:
I'm having the same issue as @azhansy here on this closed issue.
I've just updated my app from Flutter 1.x.x to 2.x.x and using flare_flutter 3.0.2.
Everything was working fine under Flutter 1.x.x, but since upgrading my code to work with 2.2.3, this is the only problem I'm experiencing in my app. The error output is:
I created a helper class for my Flare/Rive animations as below:
Basically, on initialisation, I cache the flare assets so they're all ready to be animated. Then call the
play()
function to run the animation.This all used to work beautifully in the past. Now, with Flutter 2.x I'm getting the above error (even if I don't cache the files and attempt to play the files directly). It appears to be that
_paint
is not getting initialised inflare.dart
.Any pointers/help are most appreciated!
The text was updated successfully, but these errors were encountered: