Mindinventory / animated_icons

This package supports an animated icon with some customization. It includes an icon type, animation as well as onTap() parameters through the user to get the values as per the requirements.
https://www.mindinventory.com/flutter-app-development.php
MIT License
17 stars 11 forks source link

All Tickers must be disposed before calling super.dispose() #2

Closed slhezn closed 2 years ago

slhezn commented 2 years ago

Hi,

Thanks for cool library...

My Codes... `class _SaveButtonIcon extends StatelessWidget { const _SaveButtonIcon({Key? key}) : super(key: key);

@override Widget build(BuildContext context) => AnimateIcon( onTap: () => context.read().save(context), iconType: context.watch().iconType, animateIcon: context.watch().icon, color: Theme.of(context).cardColor); }`

and this is error:

════════ Exception caught by widgets library ═══════════════════════════════════ The following assertion was thrown while finalizing the widget tree: _AnimateIconState#7a4a2(tickers: tracking 1 ticker) was disposed with an active Ticker.

_AnimateIconState created a Ticker via its TickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. All Tickers must be disposed before calling super.dispose().

Tickers used by AnimationControllers should be disposed by calling dispose() on the AnimationController itself. Otherwise, the ticker will leak.

deep-mindinventory commented 2 years ago

@slhezn please check out a new version. It is fixed. Thanks.