deleteItem method Null safety
- TutorialModel model,
- TutorialEntryModel deleteItem
override
Implementation
@override
TutorialModel deleteItem(TutorialModel model, TutorialEntryModel deleteItem) {
var newItems = <TutorialEntryModel>[];
if (model.tutorialEntries != null) {
for (var item in model.tutorialEntries!) {
if (item != deleteItem) {
newItems.add(item);
}
}
}
var newModel = model.copyWith(tutorialEntries: newItems);
return newModel;
}