📌  相关文章
📜  尝试更新您的 pubspec.yaml 以将最小 SDK 约束设置为 2.12.0 或更高版本,然后运行 'pub get - 不管代码示例

📅  最后修改于: 2022-03-11 14:59:40.735000             🧑  作者: Mango

代码示例1
Null safety is no longer an experiment as of Dart 2.12. It is now easy to enable.

Enabling null safety:

Starting with the first Dart 2.12 versions, types will be non-nullable by default. 
So you just need to change your SDK constraint:

environment:
  sdk: ">=2.12.0 <3.0.0"