firstWhere method

CsvRow? firstWhere(
  1. bool test(
    1. CsvRow row
    )
)

Find first row matching predicate (or null).

Implementation

CsvRow? firstWhere(bool Function(CsvRow row) test) {
  final headerMap = buildHeaderMap();
  for (final r in rawData) {
    final row = CsvRow(r, headerMap);
    if (test(row)) return row;
  }
  return null;
}