2d-inc/Flare-Flutter

[1.5.4] Animation never complete on widget test

Opened this issue · 2 comments

After upgrade to flare 1.5.4 (required by flutter upgrade to 1.7), we started to have our widget test fail.
After debugging , we found that in flare_cache_asset.dart, asset were not loaded before the test fail.
This is not an issue in 1.5.1

Can you post a code example of the widget and test? The loading is now async so you may need to pump multiple times.

Hi @luigi-rosso :
here is a code and test example:
below widget build FlareActor and the callback tell us the animation has complete and we'll forward in our flow, the call back is hit when I run the app but is not hit when I run the test.

Widget _getFlareAnimation(BuildContext context, String animationName) {
return Center(
child: Container(
width: 206,
height: 120,
child: FlareActor(
'packages/syi_ui/flare/vin_details_animations.flr',
alignment: Alignment.center,
fit: BoxFit.contain,
animation: animationName,
callback: (name) {
Provider.of(context).flareAnimationComplete();
},
),
),
);
}