flutter_vant_kit icon indicating copy to clipboard operation
flutter_vant_kit copied to clipboard

bug Unhandled Exception: setState() called after dispose(): _DemoButton

Open zeronyist opened this issue 5 years ago • 2 comments

thanks your perfect ui framework. when i run demo,i get such error:

E/flutter (20403): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: setState() called after dispose(): _DemoButton#3b59a(lifecycle state: defunct, not mounted) E/flutter (20403): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. E/flutter (20403): The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree. E/flutter (20403): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose(). E/flutter (20403): #0 State.setState. (package:flutter/src/widgets/framewo

zeronyist avatar Mar 11 '20 15:03 zeronyist

thanks your perfect ui framework. when i run demo,i get such error:

E/flutter (20403): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: setState() called after dispose(): _DemoButton#3b59a(lifecycle state: defunct, not mounted) E/flutter (20403): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. E/flutter (20403): The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree. E/flutter (20403): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose(). E/flutter (20403): #0 State.setState. (package:flutter/src/widgets/framewo

What version do you use flutter

benjaken avatar Mar 12 '20 03:03 benjaken

flutter --version

Flutter 1.12.13+hotfix.8 • channel stable • https://github.com/flutter/flutter.git Framework • revision 0b8abb4724 (4 weeks ago) • 2020-02-11 11:44:36 -0800 Engine • revision e1e6ced81d Tools • Dart 2.7.0

run in [android-virtual-device android-virtual-device

zeronyist avatar Mar 12 '20 12:03 zeronyist