-
-
Notifications
You must be signed in to change notification settings - Fork 143
Description
Affected version
0.16.2
Flutter versions
3.24.4
No same issues found.
- Yes, I search all issues but not found.
Steps to Reproduce
- webf自定义列表元素
- 在vue中使用该元素,
- 出现错误: Unhandled Exception: setState() called after dispose(): HTMLElementState#4a7e5(lifecycle state: defunct, not mounted)
Code example
none
Expected results
none
Actual results
E/flutter ( 7720): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: setState() called after dispose(): HTMLElementState#4a7e5(lifecycle state: defunct, not mounted)
E/flutter ( 7720): 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 ( 7720): 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 ( 7720): 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 ( 7720): #0 State.setState. (package:flutter/src/widgets/framework.dart:1167:9)
E/flutter ( 7720): #1 State.setState (package:flutter/src/widgets/framework.dart:1202:6)
E/flutter ( 7720): #2 HTMLElementState.addWidgetChild. (package:webf/src/widget/element_to_widget_adapter.dart:37:7)
E/flutter ( 7720): #3 new Future.microtask. (dart:async/future.dart:285:40)
E/flutter ( 7720): #4 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter ( 7720): #5 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter ( 7720):