2d-inc / Nima-Flutter

MIT License
199 stars 37 forks source link

on Back button pressed on Android, Nima Animation runs faster than default 0.2 seconds #11

Open zechariahks opened 5 years ago

zechariahks commented 5 years ago

Example Code:

child: Container( height: 50.0, width: 75.0, // padding: EdgeInsets.all(5.0), child: NimaActor("assets/Rabbits/rabbits.nma", alignment: Alignment.bottomRight, fit: BoxFit.contain, animation: _animationNameRabbit,), ),

I am using Navigator method to come back to a specific page. When the page loads, the animation runs faster than usual speed.

onTap: () { Navigator.of(context).push( MaterialPageRoute( maintainState: false, builder: (context) => LoadQuizPage("rabbit")) );

luigi-rosso commented 5 years ago

Thanks for submitting the sample code, do you happen to have a link to your animation file as well?

I suspect this is related to the some of the scheduler callback cleanup we did for the Flare-Flutter package that we need to backport to the Nima package as well.

If you'd like to contribute a fix for this, I'd start by comparing the Nima Flutter widget in: https://github.com/2d-inc/Nima-Flutter/blob/master/lib/nima_actor.dart

To the one in Flare (newer): https://github.com/2d-inc/Flare-Flutter/blob/master/flare_flutter/lib/flare_actor.dart

In the meantime I'll add it to our roadmap (which you can see here https://portal.productboard.com/twodimensions/tabs/1-under-consideration).

zechariahks commented 5 years ago

@luigi-rosso thanks for your reply. I am using https://www.2dimensions.com/a/JuanCarlos/files/nima/mammals/preview animation.

Apart from this issue, I have another question. What is the suggested animation framework between, Nima and Flare?