0

I am new to flutter and I got this error when I tried to run the flutter run command. I found many articles related to this issue and got to know that flutter run --no-sound-null-safety is the solution to this issue during development. But my question is that What if I get this error during the production build? How can I handle it there?

1
  • What dependencies do not support it? Are they important? Usual I would recommend not using packages that do not support null-safety by now, since they are probably not really being developed anymore and might cause issues in the future. if at all possible, your goal should be to run with null-safety enabled, not to suppress the issue. Commented Jun 17, 2021 at 18:45

1 Answer 1

2

flutter build <target> --no-sound-null-safety works too (as does flutter test --no-sound-null-safety FYI).

Note that this is a compilation error. If it fails, you won't get your APK (or whatever you're targeting), so this is not something you need to worry about happening "in production".

However, if you're new to Flutter, and the project is still young, consider trying to remove the null-unsafe dependencies. The command flutter pub outdated --mode=null-safety will give you info on which packages don't support null safety, and whether they can be upgraded.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.