brianegan/scoped_model

Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe

Closed this issue · 1 comments

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
At this point the state of the widget's element tree is no longer stable. To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.

@OverRide
Widget build(BuildContext context) {
return ScopedModelDescendant(
builder: (context, child, model) {
return Scaffold(

.....

ScopedModel.of(context, rebuildOnChange: true)
.setUDID(udid);

@pheromone Looks lke context of the widget is gone. Check whether you are disposing the context before setUDID