firstWhereOrNull method

MapEntry<K, V>? firstWhereOrNull(
  1. bool test(
    1. MapEntry<K, V>
    )
)

Returns the first entry that satisfies the given predicate test, or null if there are none.

Implementation

MapEntry<K, V>? firstWhereOrNull(bool Function(MapEntry<K, V>) test) {
  try {
    return this.entries.firstWhere(test);
  } catch (_) {
    return null;
  }
}