TheAlphamerc/empty_widget

Widget wont dispose eventually

Closed this issue · 2 comments

Describe the bug
Exception is thrown, possible memory leak on devices.

Logs

I/flutter (21090): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (21090): The following assertion was thrown while finalizing the widget tree:
I/flutter (21090): _EmptyListWidgetState#0e91d(tickers: tracking 1 ticker) was disposed with an active Ticker.
I/flutter (21090): _EmptyListWidgetState created a Ticker via its TickerProviderStateMixin, but at the time dispose()
I/flutter (21090): was called on the mixin, that Ticker was still active. All Tickers must be disposed before calling
I/flutter (21090): super.dispose().
I/flutter (21090): Tickers used by AnimationControllers should be disposed by calling dispose() on the
I/flutter (21090): AnimationController itself. Otherwise, the ticker will leak.
I/flutter (21090): The offending ticker was:
I/flutter (21090):   _WidgetTicker(created by _EmptyListWidgetState#0e91d(lifecycle state: created, tickers: tracking 1
I/flutter (21090):   ticker))

To Reproduce
Steps to reproduce the behavior:

  1. Create a empty project with tabbar, showing EmptyListWidget in every bar.
  2. Go forth and back quickly many times among the bars, exception will be thrown

Expected behavior
Errors not happening

@brunodmn issue is fixed.

Thank you!