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

_GZXDropDownHeaderState setsState(() {}) line 64 error #5

Closed
josephchenghmlet opened this issue Aug 7, 2019 · 1 comment
Closed

Comments

@josephchenghmlet
Copy link
Contributor

As title stated.

══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════
I/flutter (19929): The following assertion was thrown while dispatching notifications for GZXDropdownMenuController:
I/flutter (19929): setState() called after dispose(): _GZXDropDownHeaderState#bfc38(lifecycle state: defunct, not
I/flutter (19929): mounted)
I/flutter (19929): This error happens if you call setState() on a State object for a widget that no longer appears in
I/flutter (19929): the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
I/flutter (19929): can occur when code calls setState() from a timer or an animation callback.
I/flutter (19929): The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
I/flutter (19929): callback. Another solution is to check the "mounted" property of this object before calling
I/flutter (19929): setState() to ensure the object is still in the tree.
I/flutter (19929): This error might indicate a memory leak if setState() is being called because another object is
I/flutter (19929): retaining a reference to this State object after it has been removed from the tree. To avoid memory
I/flutter (19929): leaks, consider breaking the reference to this object during dispose().
I/flutter (19929): 
I/flutter (19929): When the exception was thrown, this was the stack:
I/flutter (19929): #0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1105:9)
I/flutter (19929): #1      State.setState (package:flutter/src/widgets/framework.dart:1140:6)
I/flutter (19929): #2      _GZXDropDownHeaderState._onController (package:gzx_dropdown_menu/src/gzx_dropdown_header.dart:64:5)
I/flutter (19929): #3      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:206:21)
I/flutter (19929): #4      GZXDropdownMenuController.show (package:gzx_dropdown_menu/src/gzx_dropdown_menu_controller.dart:13:5)
I/flutter (19929): #5      _GZXDropDownHeaderState._menu.<anonymous closure> (package:gzx_dropdown_menu/src/gzx_dropdown_header.dart:124:29)
I/flutter (19929): #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
I/flutter (19929): #7      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)
I/flutter (19929): #8      TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:312:7)
I/flutter (19929): #9      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
I/flutter (19929): #10     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
I/flutter (19929): #11     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
I/flutter (19929): #12     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
I/flutter (19929): #13     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
I/flutter (19929): #14     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
I/flutter (19929): #18     _invoke1 (dart:ui/hooks.dart:250:10)
I/flutter (19929): #19     _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
I/flutter (19929): (elided 3 frames from package dart:async)
I/flutter (19929): 
I/flutter (19929): The GZXDropdownMenuController sending notification was:
I/flutter (19929):   Instance of 'GZXDropdownMenuController'
I/flutter (19929): ════════════════════════════════════════════════════════════════════════════════════════════════════

Will submit a new pull request soon.

@GanZhiXiong
Copy link
Owner

fix, merged request

#7 (comment)

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

2 participants