I'm trying to build app using hive but the hive_flutter package doesn't supporting null safety.
Is there any way to turn off null safety for this package only or is there any alternative for the hive_flutter package?
I'm trying to build app using hive but the hive_flutter package doesn't supporting null safety.
Is there any way to turn off null safety for this package only or is there any alternative for the hive_flutter package?
To turn off null safety, change sdk environment in pubspec.yaml to this:
environment:
sdk: ">=2.7.0 <3.0.0"
According to Migrating to null safety, all your dependencies must be migrated to null safety first:
Here are the basic steps for migrating each package that you own:
- Wait for the packages that you depend on to migrate.
- ...
Migrating an app is technically the same as migrating a package. Before migrating an app, make sure that all of your dependencies are ready.
But hive_flutter
supports null safety since version 1.0.0 (March 5 2021). So you should simply upgrade it.