This also might be helpful in some cases, specially when dealing with STATE from riverpod:
if (state.contains(foo)) { state = state.where((item) => item.id != foo.id).toList(); }