Propery load a .hive file from assets using rootBundle
Open
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.