![[已解决] You can enable the experiment using the ‘--enable-experiment=non-nullable‘ command line option,第1张 [已解决] You can enable the experiment using the ‘--enable-experiment=non-nullable‘ command line option,第1张](/aiimages/%5B%E5%B7%B2%E8%A7%A3%E5%86%B3%5D+You+can+enable+the+experiment+using+the+%E2%80%98--enable-experiment%3Dnon-nullable%E2%80%98+command+line+option.png)
Error: This requires the null safety language feature,
which is experimental. You can enable the experiment
using the '--enable-experiment=non-nullable' command line option.
解决方法
解决这个问题需要两个步骤:
确认 Flutter 版本(若版本过低,即便调整下方 SDK 版本也无法成功让环境运作)在pubspec.yaml文件中调整environment参数底下的sdk版本。(可以先调整 SDK 版本,若无法顺利让环境运作,再来升级 Flutter 版本)
flutter upgrade
environment:
sdk: ">=2.12.0 <3.0.0"
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)