whereOrNull method

Iterable<T>? whereOrNull(
  1. ConditionTester<T> test
)

Returns an iterable with elements that match a condition, or null if none match.

Implementation

Iterable<T>? whereOrNull(ConditionTester<T> test) {
  final filtered = where(test);
  return filtered.isEmpty ? null : filtered;
}