removeLastWhere method
bool
removeLastWhere(
{ - bool removeIf(
- T item
)?,
- T? removeItem,
})
Implementation
bool removeLastWhere({bool removeIf(T item)?, T? removeItem}) {
assert(removeIf != null || removeItem != null);
assert(removeIf == null || removeItem == null);
if (this == null) return false;
int lastIndex = this!.lastIndexWhere((item) {
return removeItem != null ? removeItem == item : removeIf!(item);
});
if (lastIndex >= 0) {
this!.removeAt(lastIndex);
return true;
} else {
return false;
}
}