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

Active animation ticker and Lifecycle assertion failure. #52

Open
zzzaJ opened this issue Jun 15, 2021 · 0 comments
Open

Active animation ticker and Lifecycle assertion failure. #52

zzzaJ opened this issue Jun 15, 2021 · 0 comments

Comments

@zzzaJ
Copy link

zzzaJ commented Jun 15, 2021

Hello,

When I am trying to pop away from an open drawer (when user signs out), I am presented with the following errors.
Is this a bug, or something I have incorrectly done on my side?

======== Exception caught by widgets library =======================================================
The following assertion was thrown while finalizing the widget tree:
_DrawerScaffoldState#4c862(tickers: tracking 1 ticker) was disposed with an active Ticker.

_DrawerScaffoldState 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 _DrawerScaffoldState#4c862(lifecycle state: created, tickers: tracking 0 tickers))
The stack trace when the _WidgetTicker was actually created was:
#0 new Ticker. (package:flutter/src/scheduler/ticker.dart:67:40)
#1 new Ticker (package:flutter/src/scheduler/ticker.dart:69:6)
#2 new _WidgetTicker (package:flutter/src/widgets/ticker_provider.dart:271:81)
#3 TickerProviderStateMixin.createTicker (package:flutter/src/widgets/ticker_provider.dart:202:34)
#4 new AnimationController (package:flutter/src/animation/animation_controller.dart:247:21)
#5 new MenuController (package:drawerbehavior/drawer_scaffold.dart:566:36)
#6 _DrawerScaffoldState.dcreateController (package:drawerbehavior/drawer_scaffold.dart:165:33)
#7 _DrawerScaffoldState.createController (package:drawerbehavior/drawer_scaffold.dart:150:33)
#8 MappedListIterable.elementAt (dart:_internal/iterable.dart:412:31)
#9 ListIterator.moveNext (dart:_internal/iterable.dart:341:26)
#10 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27)
#11 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#12 new List.of (dart:core-patch/array_patch.dart:50:28)
#13 ListIterable.toList (dart:_internal/iterable.dart:212:44)
#14 _DrawerScaffoldState.assignContoller (package:drawerbehavior/drawer_scaffold.dart:177:65)
#15 _DrawerScaffoldState.initState (package:drawerbehavior/drawer_scaffold.dart:128:5)
#16 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4711:57)
#17 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548:5)
... Normal element mounting (9 frames)
#26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611:14)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:3360:20)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#30 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2582:33)
#31 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:875:21)
#32 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328:5)
#33 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#34 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9)
#35 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998:5)
#39 _invoke (dart:ui/hooks.dart:163:10)
#40 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259:5)
#41 _drawFrame (dart:ui/hooks.dart:126:31)
(elided 3 frames from dart:async)

When the exception was thrown, this was the stack:
#0 TickerProviderStateMixin.dispose. (package:flutter/src/widgets/ticker_provider.dart:219:13)
#1 TickerProviderStateMixin.dispose (package:flutter/src/widgets/ticker_provider.dart:237:6)
#2 _DrawerScaffoldState.dispose (package:drawerbehavior/drawer_scaffold.dart:140:11)
#3 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:4800:11)
#4 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1847:13)
...

======== Exception caught by foundation library ====================================================
The following assertion was thrown while dispatching notifications for MenuController:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 4188 pos 12: '_lifecycleState != _ElementLifecycle.defunct': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4188:12)
#3 State.setState (package:flutter/src/widgets/framework.dart:1108:15)
#4 _DrawerScaffoldState.createController. (package:drawerbehavior/drawer_scaffold.dart:159:26)
#5 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:243:25)
#6 new MenuController. (package:drawerbehavior/drawer_scaffold.dart:574:9)
...
The MenuController sending notification was: Instance of 'MenuController'

======== Exception caught by foundation library ====================================================
The following assertion was thrown while dispatching notifications for MenuController:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 4188 pos 12: '_lifecycleState != _ElementLifecycle.defunct': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4188:12)
#3 State.setState (package:flutter/src/widgets/framework.dart:1108:15)
#4 _DrawerScaffoldState.createController. (package:drawerbehavior/drawer_scaffold.dart:159:26)
#5 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:243:25)
#6 new MenuController. (package:drawerbehavior/drawer_scaffold.dart:592:9)
...
The MenuController sending notification was: Instance of 'MenuController'

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

1 participant