Skip to content

Commit 79e7da9

Browse files
committed
Replace remove with removeWhere call
1 parent 009a01d commit 79e7da9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/api/state/actions/item_actions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class ItemRemoveAction extends ReduxAction<AppState> {
8686
Future<AppState?> reduce() async {
8787
final ItemModel removedEntry = await ApiService().itemApi.remove(model);
8888
final List<ItemModel> items = List.of(state.items.items, growable: true)
89-
..remove(removedEntry);
89+
..removeWhere((element) => element.id == removedEntry.id);
9090
return _updateItemInState(state, items, null);
9191
}
9292
}

0 commit comments

Comments
 (0)