【发布时间】:2019-09-14 09:51:28
【问题描述】:
我正在玩弄不可为空的类型并将其添加到我的analysis_options.yaml:
analyzer:
enable-experiment:
- non-nullable
我有一个使用可空性扩展的代码生成器。 Visual Code 对我的代码很好。
现在,我尝试运行:
flutter packages pub run build_runner watch
我收到此错误消息:
[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
[SEVERE] xyz.dart:95:7: Error: This requires the 'non-nullable' experiment to be enabled.Try enabling this experiment by adding it to the command line when compiling and running.
如何将--enable-experiment:non-nullable 传递给flutter packages pub run?
如果我运行,也会发生同样的情况:
flutter build ios
我收到错误消息:
lib/main.dart:61:26: Error: This requires the 'non-nullable' experiment to be enabled.
Try enabling this experiment by adding it to the command line when compiling and running.
所以,同样的问题:我怎样才能将--enable-experiment:non-nullable 传递给flutter build?
【问题讨论】:
-
github.com/flutter/flutter/issues/40490,只要将其链接回此处以防更新