firstWhere method
Returns the first element that satisfies the given predicate function.
function: A function that returnstruefor the desired element.- Returns: The first matching element.
- Throws: A StateError if no element matches.
Implementation
T firstWhere(bool Function(T function) function) =>
value.firstWhere(function);