smartherd / Flutter-Demos

Learn to develop mobile apps using Flutter for both Android and iOS
315 stars 296 forks source link

Looking up a deactivated widgets ancestor is unsafe #2

Open wyklif opened 5 years ago

wyklif commented 5 years ago

Hi, thanks for the wonderful tutorial. I keep getting the error looking Up a deactivated widgets ancestor is unsafe. At this point the state of the element tree is no longer stable to safely refer to a widget's ancestor in it's dispose() method, save a reference to the ancestor by calling InheritFromWidgetOfExactType() in the widget's didChangeDependancies() method

This occurs during clicking save when creating a new note and it tries to pop back to the notelist view

umayyah commented 5 years ago

hello, did you find a solution for this error ?

cseshubham commented 5 years ago

Hi Friends, Pls use this below code or only need to remove "context: context" from showDialog inside node_details.dart,

showDialog(
    //context: context, 
    builder: (_) => alertDialog
);

Now it's working fine.

Rizwankhan12 commented 5 years ago

Nope it's still not working.

Thaajwer commented 5 years ago

thanks for the tutorials