Flutter hive unit test

Issue I got a problem with testing function calling hive put method, now i’m gonna provide my code for the function, test and the error message ///////////////////// Function impl. //////////////////////// class AppLocalDataSourceImpl implements AppLocalDataSource { static const _kTag = "AppLocalDataSource";

Continue reading

Flutter Hive Box delete function don't work

Issue class HomeCubit extends Cubit<HomeState> { HomeCubit() : super(HomeInitial()); var savedBox = Boxes.savedBox; addSavedProduct(ProductModel product) { savedBox.add(product); print(savedBox.length); emit(HomeSuccess()); } removeSavedProduct(ProductModel product) { try { if (product.id != null) { savedBox.delete(product.id!); emit(HomeSuccess()); } else { print("Invalid product id"); } }

Continue reading