deleteItem method

  1. @override
FollowingDashboardModel deleteItem(
  1. FollowingDashboardModel model,
  2. MemberActionModel deleteItem
)
override

Implementation

@override
FollowingDashboardModel deleteItem(
    FollowingDashboardModel model, MemberActionModel deleteItem) {
  var newItems = <MemberActionModel>[];
  for (var item in model.memberActions!) {
    if (item != deleteItem) {
      newItems.add(item);
    }
  }
  var newModel = model.copyWith(memberActions: newItems);
  return newModel;
}