Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when going to another activity, related to disposing the animationController #8

Open
ajouni opened this issue Aug 16, 2024 · 6 comments

Comments

@ajouni
Copy link

ajouni commented Aug 16, 2024

how to fix this

======== Exception caught by widgets library =======================================================
The following assertion was thrown while finalizing the widget tree:
_AnimateGradientState#374be(tickers: tracking 2 tickers) was disposed with an active Ticker.

_AnimateGradientState 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.

The offending ticker was: _WidgetTicker(created by _AnimateGradientState#374be)
The stack trace when the _WidgetTicker was actually created was:
#0 new Ticker. (package:flutter/src/scheduler/ticker.dart:71:40)
#1 new Ticker (package:flutter/src/scheduler/ticker.dart:73:6)
#2 new _WidgetTicker (package:flutter/src/widgets/ticker_provider.dart)
#3 TickerProviderStateMixin.createTicker (package:flutter/src/widgets/ticker_provider.dart:296:34)
#4 new AnimationController (package:flutter/src/animation/animation_controller.dart:265:21)
#5 _AnimateGradientState._setAnimations (package:animate_gradient/animate_gradient_widget.dart:201:9)
#6 _AnimateGradientState._initialize (package:animate_gradient/animate_gradient_widget.dart:122:5)
#7 _AnimateGradientState.initState (package:animate_gradient/animate_gradient_widget.dart:107:5)
#8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5611:55)
#9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5456:5)
... Normal element mounting (25 frames)
#34 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4335:16)
#35 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6893:36)
#36 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6905:32)
... Normal element mounting (266 frames)
#302 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4335:16)
#303 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6893:36)
#304 Element.updateChild (package:flutter/src/widgets/framework.dart:3846:18)
#305 Element.updateChildren (package:flutter/src/widgets/framework.dart:4033:32)
#306 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6918:17)
#307 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#308 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#309 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#310 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#311 StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#312 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#313 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#314 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#315 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#316 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#317 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#318 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#319 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#320 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#321 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#322 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#323 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#324 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#325 StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#326 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#327 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#328 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#329 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#330 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#331 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#332 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#333 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#334 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#335 StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#336 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#337 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#338 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#339 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#340 StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#341 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#342 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#343 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#344 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#345 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#346 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#347 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#348 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#349 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#350 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#351 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#352 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#353 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#354 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#355 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#356 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#357 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19)
#358 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21)
#359 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#360 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#361 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#362 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#363 _invoke (dart:ui/hooks.dart:312:13)
#364 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#365 _drawFrame (dart:ui/hooks.dart:283:31)

When the exception was thrown, this was the stack:
#0 TickerProviderStateMixin.dispose. (package:flutter/src/widgets/ticker_provider.dart:343:13)
#1 TickerProviderStateMixin.dispose (package:flutter/src/widgets/ticker_provider.dart:361:6)
#2 _AnimateGradientState.dispose (package:animate_gradient/animate_gradient_widget.dart:215:11)
#3 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5689:11)
#4 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2076:13)
#5 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#6 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#7 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#8 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#9 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#10 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#11 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#12 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#13 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#14 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#15 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#16 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#17 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#18 MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6856:16)
#19 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#20 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#21 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#22 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#23 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#24 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#25 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#26 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#27 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#28 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#29 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#30 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#31 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#32 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#33 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#34 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#35 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#36 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#37 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#38 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#39 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#40 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#41 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#42 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#43 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#44 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#45 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#46 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#47 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#48 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#49 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#50 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#51 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#52 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#53 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#54 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#55 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#56 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#57 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#58 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#59 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#60 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#61 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#62 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#63 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#64 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#65 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#66 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#67 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#68 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#69 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#70 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#71 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#72 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#73 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#74 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#75 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#76 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#77 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#78 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#79 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#80 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#81 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#82 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#83 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#84 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#85 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#86 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#87 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#88 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#89 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#90 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#91 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#92 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#93 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#94 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#95 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#96 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#97 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#98 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#99 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#100 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#101 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#102 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#103 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#104 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#105 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#106 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#107 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#108 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#109 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#110 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#111 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#112 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#113 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#114 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#115 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#116 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#117 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#118 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#119 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#120 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#121 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#122 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#123 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#124 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#125 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#126 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#127 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#128 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#129 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#130 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#131 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#132 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#133 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#134 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#135 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6744:14)
#136 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#137 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#138 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#139 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#140 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#141 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#142 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#143 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#144 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#145 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#146 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:2074:7)
#147 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#148 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2072:13)
#149 ListIterable.forEach (dart:_internal/iterable.dart:49:13)
#150 _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:2085:25)
#151 BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2764:15)
#152 BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3174:7)
#153 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:992:19)
#154 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#155 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#156 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#157 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#158 _invoke (dart:ui/hooks.dart:312:13)
#159 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#160 _drawFrame (dart:ui/hooks.dart:283:31)

@hunter7149
Copy link

Still no update!

@Vikaskumar75
Copy link
Owner

Apologies for the delay.
We will look into this as soon as possible.

Thanks for the feedback.

@zaid-kamil
Copy link

no update yet. Removing the library from my project

@FaFre
Copy link

FaFre commented Oct 11, 2024

There is already a PR with a fix for that: #6

@codingiswhyicry
Copy link

On the most updated version of the package, and still experiencing this error. I think it may be leading to a major memory leak with multiple gradients on one page, so I have to remove it from my project entirely.

@md-rifatkhan
Copy link

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants