Open mike1985dev opened 2 years ago
Hello, in my Flutter App using Hive is all running correct till I restart the App. Then the box is empty and the Object is not stored? Till I restart the App again, all is working fine. The Object is generated with the build_runner
@HiveType(typeId: 0) class Favorites extends HiveObject { @HiveField(0) List<MediaItem> mediaItems = []; } final document = await getApplicationDocumentsDirectory(); Hive ..init(document.path) ..registerAdapter(FavoritesAdapter()) await Hive.openBox<Favorites>('favorites'); ....... Box<Favorites> box = Hive.box<Favorites>('favorites'); Favorites fav = box.getAt(0) ?? Favorites(); fav.mediaItems.insert(0, playlist[i]);
The data are stored and when I restart the App the Box is empty??? Thanks for helping!
similar case https://github.com/hivedb/hive/issues/1002
+1
Hello, in my Flutter App using Hive is all running correct till I restart the App. Then the box is empty and the Object is not stored? Till I restart the App again, all is working fine. The Object is generated with the build_runner
The data are stored and when I restart the App the Box is empty??? Thanks for helping!