当我们兴高采烈的更新到flutter2.0时,运行项目时,嘎,报错了。
莫慌。往下看解决方法。
我们找到flutter的根目录,搜索provide.dart,使用vscode打开它,在页面搜索以下内容:
final widget = context.inheritFromWidgetOfExactType(_InheritedProviders);
将以上内容改为:
final widget = context.dependOnInheritedWidgetOfExactType(aspect: _InheritedProviders);
保存,搞定。