singleWhere method

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

Returns the single element that satisfies test. Iterable.lastWhere

Implementation

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