jaumard / flare_loading

Loading widget based on a Flare animation, allow you to create beautiful custom loading widgets or dialogs
MIT License
25 stars 9 forks source link

endAnimation not shown #3

Open JsonLinesCode opened 4 years ago

JsonLinesCode commented 4 years ago

Here is my issue : when I start my application I've made an animation looping during the loading of a future process and another animation when the future has data. So here is my code : (I've replaced my future with a simple delay but it does the same.

return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
          child: FlareLoading(
        until: () => Future.delayed(Duration(seconds: 5)),
        name: 'assets/animations/ynotes.flr',
        loopAnimation: 'Load',
        endAnimation: 'Ended',
        onSuccess: (test) {
          Navigator.of(context).pushReplacement(router(homePage()));
        },
        onError: (__, _) {
          Navigator.of(context).pushReplacement(router(login()));
        },
      )

Unfortunately I can't upload my .flr file, so here is the link https://rive.app/a/modeeeeeeeeern/files/flare/ynotes/embed

jaumard commented 4 years ago

To upload your .flr file just zip it before. I can't export your .flr file as it's read only ;)

But maybe this will work better for you:

return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
          child: FlareLoading(
        until: () => Future.delayed(Duration(seconds: 5)),
        name: 'assets/animations/ynotes.flr',
        startAnimation: 'Load',
        loopAnimation: 'Load',
        endAnimation: 'Ended',
        onSuccess: (test) {
          Navigator.of(context).pushReplacement(router(homePage()));
        },
        onError: (__, _) {
          Navigator.of(context).pushReplacement(router(login()));
        },
      )

Let me know :) maybe I have a bug when only loopAnimation and endAnimation are given. I'll check later

JsonLinesCode commented 4 years ago

Ok I didn't know : ynotes.zip I've tried with the startAnimation but it does exactly the same : the Load animation freezes and I'm redirected to my home page...

jaumard commented 4 years ago

Ok I'll take a look asap then, sorry for that

3dluis commented 4 years ago

The same problem, some solution.