firstWhere method

MapEntry<K, V> firstWhere(
  1. bool test(
    1. K key,
    2. V value
    ), {
  2. MapEntry<K, V> orElse()?,
})

Returns the first entry that satisfies the given predicate test. Iterable.firstWhere

Implementation

MapEntry<K, V> firstWhere(
  bool Function(K key, V value) test, {
  MapEntry<K, V> Function()? orElse,
}) {
  return entries.firstWhere((entry) => test(entry.key, entry.value), orElse: orElse);
}