lastOrNull method

E? lastOrNull({
  1. bool f(
    1. E e
    )?,
})

Implementation

E? lastOrNull({bool f(E e)?}) {
  if (f == null) return this.isEmpty ? null : last;
  for (int i = this.length - 1; i >= 0; i--) {
    E ee = this.elementAt(i);
    if (f(ee)) return ee;
  }
  return null;
}