// opening the box.....
var savedList; Future initiateHive() async { ///Creating a HiveBox to Store data savedList = await Hive.openBox('Musicbox'); } //the function to put data to hive
var songFav = SongPlayList()..songInfo = songs[currentIndex].id; print(songs[currentIndex].id); savedList.put(songs[currentIndex].id, songFav); //the error is....
Another exception was thrown: NoSuchMethodError: The method 'put' was called on null. https://stackoverflow.com/questions/66827774/flutter-the-method-was-called-on-null-error-flutter-hive March 27, 2021 at 11:34AM
没有评论:
发表评论