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

Since flutter 2, flutter has enabled null security by default in the configuration. By incorporating null checking into the type system, these errors can be caught during development, so as to prevent crashes caused by the reproduction environment. If empty security is enabled in the current project and the imported third-party plug-in is not adapted, the operation returns the following error.

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

 - package:provider

For solutions, see https://dart.dev/go/unsound-null-safety
Restarted application in 341ms.

At this time, you can check whether the new version of the imported plug-in supports empty security. If the plug-in supports empty security, the plug-in platform will mark it as empty security:


if the imported plug-in does not support empty security, you can execute the following commands on the terminal to run the software

flutter run --no-sound-null-safety


Read More: