Add the following to your
pubspec.yaml. Use the latest version instead of
dependencies:hive: ^[version]hive_flutter: ^[version]dev_dependencies:hive_generator: ^[version]build_runner: ^[version]
Before you can use Hive in your app, you must initialize it. This only has to be done once.
Give Hive a directory where it can store its files. It is recommended to use an empty directory. Each box will have it's own
.hive file in the Hive-home directory.
If you use a directory outside your app files, make sure to request runtime permission on Android.
In the browser you don't have to call
All of your data is stored in boxes.
var box = await Hive.openBox('testBox');
Hive supports all primitive types,
Uint8List. Any object can be can stored using TypeAdapters.
box.put('name', 'David');var name = box.get('name');print('Name: $name');