local_hero icon indicating copy to clipboard operation
local_hero copied to clipboard

Would be great to have a callback on animationEnded

Open FrankDomburg opened this issue 2 years ago • 2 comments

Sometimes, I want to do stuff after the local heroes are done animating.

Current flow is that I change the inflightbuilder to add False to an array, whenever a local hero starts animating, and to add True to the same array when the status is animationStatus == completed. Whenever the number of True == number of False, I do what I want to do next.

Does it make sense for the LocalHeroController to provide a callback to do, I guess that would be way more efficient than a bunch of setState commands?

FrankDomburg avatar Mar 22 '22 13:03 FrankDomburg

@FrankDomburg created a PR for this, the callback is slightly delayed by about 300 milliseconds but works great otherwise, but looking at the other PRs that havent been merged it may be better to create a new package and just link back to this

martipello avatar Nov 11 '22 11:11 martipello

i published my fork with the added callback here https://pub.dev/packages/local_hero_with_callback

martipello avatar Nov 11 '22 14:11 martipello