Before moving on to the CRUD operations of the database, you have to initialize Hive and open a box that will be used for storing the data . Hive should be initialized before we load any boxes, so it’s best to initialize it inside the main() function of your Flutter app to avoid any errors.
Read moreHow do you make a hive adapter in Flutter?
Generate adapter
Read more