关于flutter 中的buildContext

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.

 

You’re trying to access a context that isn’t probably available. 

参考:

https://stackoverflow.com/questions/54617432/looking-up-a-deactivated-widgets-ancestor-is-unsafe

 

context不可用了,但是任然想使用,就会报这个错,mark!

你可能感兴趣的:(安卓,Flutter)