flutter findAncestorStateOfType错误

The method ‘findAncestorStateOfType’ was called on null. Receiver: null Tried calling: findAncestorStateOfType<NavigatorState>()

出现上述错误的情况是由一个对话框需要导航到另外一个页面出现的,最后修复了,是没有导入BuildContext所致。

发表评论