lastOrNull method

T? lastOrNull([
  1. bool predicate(
    1. T item
    )?
])

Implementation

T? lastOrNull([ bool Function(T item)? predicate ]) {
	Iterable<T> iter = this;
	if (predicate != null) {
		iter = this.where(predicate);
	}

	if (iter.isEmpty) {
		return null;
	}

	return iter.last;
}