firstWhere method

T firstWhere(
  1. bool function(
    1. T function
    )
)

Returns the first element that satisfies the given predicate function.

  • function: A function that returns true for 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);