deleteItem method
FeedMenuModel
deleteItem(
- FeedMenuModel model,
- LabelledBodyComponentModel deleteItem
override
Implementation
@override
FeedMenuModel deleteItem(
FeedMenuModel model, LabelledBodyComponentModel deleteItem) {
var newItems = <LabelledBodyComponentModel>[];
for (var item in model.bodyComponentsCurrentMember!) {
if (item != deleteItem) {
newItems.add(item);
}
}
var newModel = model.copyWith(bodyComponentsCurrentMember: newItems);
return newModel;
}