Closed Pabears closed 2 months ago
we could fixit in packages/flutter_earth_globe/rotating_globe.dart 558:43
if (changed) {
Future.delayed(Duration.zero, () {
// todo if (!mounted) return;
setState(() {});
});
}
@Pabears This has been fixed in the latest version 1.0.5.
hello, I have a NavigationBar and two tabs, the first tab is a list and other is the earth demo. when I switch to tab 2 (the earth) and switch back to tab 1, i got this error.
DartError: setState() called after dispose(): RotatingGlobeState#63df9(lifecycle state: defunct, not mounted, tickers: tracking 0 tickers) 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. 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. 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(). dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 296:3 throw packages/flutter/src/widgets/framework.dart 1167:9
packages/flutter/src/widgets/framework.dart 1201:14 setState
packages/flutter_earth_globe/rotating_globe.dart 558:43
dart-sdk/lib/async/future.dart 431:42
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:11 internalCallback
DartError: setState() called after dispose(): RotatingGlobeState#63df9(lifecycle state: defunct, not mounted, tickers: tracking 0 tickers)
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.
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.
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().
dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 296:3 throw
packages/flutter/src/widgets/framework.dart 1167:9
packages/flutter/src/widgets/framework.dart 1201:14 setState
packages/flutter_earth_globe/rotating_globe.dart 558:43
dart-sdk/lib/async/future.dart 431:42
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:11 internalCallback
and this is my demo Earth Page:
thanks, I think there maybe some dispose lifecycle error in the controller.