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