isar / isar/hive

Propery load a .hive file from assets using rootBundle

Open
#279 0 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

**Question**
How to properly load a **.hive** file into a box

This is how i am currently trying to load, but it's **not** working.
```dart
Future main() async {
await Hive.openBox(
'CarrierData',
crashRecovery: true,
bytes: await rootBundle
.load(
'assets/CarrierLogoData/carriers.hive',
)
.then(
(_byteData) => _byteData.buffer.asUint8List(),
),
);
runApp(const MyApp());
}
```

**Version**
- Platform: Mac
- Flutter version: 1.18.1-pre.20
- Hive version: 1.4.1+1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.