iDecode
iDecode

Reputation: 28906

How to disable Flutter/Dart experiment?

I recently run the following command to enable the non-nullable experiment in my project.

dart --enable-experiment=non-nullable main.dart

The NNBD is enabled. But how can I disable it, there' no such command like

dart --disable-experiment=non-nullable main.dart

Had I enabled it in the analysis_options.yaml file, I would have disabled it easily. But how do I disable it now (without having to use the analysis_options option)

Upvotes: 2

Views: 650

Answers (1)

Lee3
Lee3

Reputation: 3067

Dart 2.12 has turned on null safety by default. This is why you are getting errors in your editor. Add // @dart=2.9 to the beginning of any files that you want to opt out of this feature.

Upvotes: 1

Related Questions