File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/hyper_storage_hive Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,24 @@ Then, run `flutter pub get` or `dart pub get`.
2929
3030Initialize `hyper_storage` with `HiveBackend`.
3131
32+ # ## IMPORTANT
33+ > Hive backend requires initialization of Hive before use. Hyper Storage doesn't handle Hive initialization for you as
34+ > the initialization depends on whether the project is being used in Flutter or pure Dart environment.
35+ > You need to initialize Hive in your application before using the Hive backend.
36+
3237` ` ` dart
3338import 'package:hyper_storage/hyper_storage.dart';
3439import 'package:hyper_storage_hive/hyper_storage_hive.dart';
3540
3641void main() async {
42+
43+ // IMPORTANT:
44+ // Hive.initFlutter() or Hive.init() must be called before using HiveBackend.
45+ // For Flutter:
46+ // await Hive.initFlutter();
47+ // For pure Dart:
48+ // Hive.init('path_to_hive_boxes');
49+
3750 // Initialize the storage with HiveBackend
3851 final storage = await HyperStorage.init(backend: HiveBackend());
3952
You can’t perform that action at this time.
0 commit comments