zefyr
zefyr copied to clipboard
Looking up a deactivated widget's ancestor is unsafe
I am getting this error "Looking up a deactivated widget's ancestor is unsafe."
To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
I am using zefyr editor. See this for minimal example https://github.com/memspace/zefyr/issues/341
Add AutomaticKeepAliveClientMixin to your stateful widget, and add
@override
bool get wantKeepAlive => true;
as well as
super.build(context);
in widget's build method.