fix
This commit is contained in:
@@ -6,6 +6,7 @@ abstract class CategoryLocalDataSource {
|
||||
Future<List<CategoryModel>> getAllCategories();
|
||||
Future<CategoryModel?> getCategoryById(String id);
|
||||
Future<void> cacheCategories(List<CategoryModel> categories);
|
||||
Future<void> updateCategory(CategoryModel category);
|
||||
Future<void> clearCategories();
|
||||
}
|
||||
|
||||
@@ -30,6 +31,11 @@ class CategoryLocalDataSourceImpl implements CategoryLocalDataSource {
|
||||
await box.putAll(categoryMap);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateCategory(CategoryModel category) async {
|
||||
await box.put(category.id, category);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> clearCategories() async {
|
||||
await box.clear();
|
||||
|
||||
Reference in New Issue
Block a user