I do have a main application in Flutter using Hive as database, and I would like to incorporate another single application that also has Hive as database to this main app. I'm not experienced in Hive, so I don't really know what I need to do to merge both.
The code above is the main.dart from the main app:
Hive
..init(document.path)
..registerAdapter(PostsAdapter());
await Hive.openBox(appState);
This from the another main.dart one:
void main() async {
// hive initialization
await Hive.initFlutter();
Hive.registerAdapter(TodoAdapter());
await Hive.openBox(HiveBoxes.todo);
runApp(TodoApp());
}
I've tried to run the app and got this error:
HiveError: Box not found. Did you forget to call Hive.openBox()?
I do have a boxes.dart inside the folder of the second application with following code:
class HiveBoxes {
static String todo = 'todo_box';
}
I guess this is not hard to fix, so I would be glad if you help me on that!
Thanks!
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)