2

I am building a Flutter app and I need to use the flutter_redux package for my global state management.

Unfortunately when I added it and try to execute my app I am getting the below error:

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:redux
 - package:flutter_redux

Please, how can I resolve this?

ololo
  • 1,326
  • 2
  • 14
  • 47

1 Answers1

3

// @dart=2.9 - add this as is to the top of main.dart file

Alternatively, set the language version in the entrypoint — the file that contains main() function — to 2.9. In Flutter apps, this file is often named lib/main.dart. In command-line apps, this file is often named bin/.dart. You can also opt out files under test, because they are also entrypoints.

https://dart.dev/null-safety/unsound-null-safety

From dart.dev, I used it when I was having problems with packages without null-safety.

Dharman
  • 30,962
  • 25
  • 85
  • 135