Save Hive db in assets folder for future usage
Open
question
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
I want to use a pre-populated db.
**Initialization:**
```
Directory directory = await pathProvider.getApplicationDocumentsDirectory();
Hive.init(directory.path);
Hive.registerAdapter(InventoryAdapter());
```
**Add initial data:**
```
addItem(Inventory item) async {
var box = await Hive.openBox('inventory');
box.put('abc', item);
var data = box.get('abc');
print(data.description); //looks good
}
```
**How to Get Database to use in future?**
I want to save this initial database in assets folder and will make it part of the build. How can I get this database?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.