findLast method

E? findLast(
  1. bool test(
    1. E element
    )
)

查找最后一个符合条件的元素。

Implementation

E? findLast(bool Function(E element) test) {
  final list = where(test);
  return list.isEmpty ? null : list.last;
}