lastWhereOrNull method
Returns the last element for which the return value of test
is true
.
Null is returned if there is no element for which the return value of test
is true
.
test
の返り値がtrue
になる場合の最後の要素を返します。
test
の返り値がtrue
になる要素がない場合はNullが返されます。
Implementation
T? lastWhereOrNull(bool Function(T item) test) {
return toList().reversed.firstWhereOrNull(test);
}