简体   繁体   中英

How to Mix Sound Null Safety and Unsound Null Safety in Flutter

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?

// @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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM