Fix destroy bug in list of items.dart

This commit is contained in:
hanie.khodkari
2025-06-03 18:00:50 +03:30
parent bb6dfa354f
commit 860a2fd0df
3 changed files with 57 additions and 23 deletions
+1
View File
@@ -202,6 +202,7 @@ class ItemProvider extends ChangeNotifier {
'Authorization': User.token,
});
print(response.statusCode);
print(response.body);
if (response.statusCode == 200) {
+8
View File
@@ -71,6 +71,14 @@ class MyItemProvider extends ChangeNotifier {
notifyListeners();
}
Future<bool> removeItems(String id) async {
myItems!.removeWhere((item) {
return item.id.toString() == id;
});
notifyListeners();
return true;
}
// void searchHospitalItems(String value) {
// hospitalItems = [];
// searchBoxValue = value;