parseCsv function

List<List<String>> parseCsv(
  1. String input
)

A CSV reader, because this package has no dependencies and is not getting one for this.

It is the RFC 4180 subset Play actually emits: comma separated, " quoting, "" for a literal quote inside a quoted field, and CRLF or LF line endings. Anything it cannot make sense of throws FormatException naming the line, rather than guessing — a declaration read wrongly is worse than one that refuses to be read.

Implementation

List<List<String>> parseCsv(String input) =>
    parseCsvRecords(input).map((r) => r.fields).toList(growable: false);