CsvConfig constructor
const
CsvConfig({
- String fieldDelimiter = ',',
- String lineDelimiter = '\r\n',
- String quoteCharacter = '"',
- String? escapeCharacter,
- QuoteMode quoteMode = QuoteMode.necessary,
- bool addBom = false,
- bool autoDetect = true,
- bool skipEmptyLines = true,
- bool hasHeader = false,
- bool dynamicTyping = true,
- bool parseDates = false,
- bool strict = false,
- String? comment,
- int skipRows = 0,
- int? maxRows,
- bool skipInitialSpace = false,
- Set<
String> nullValues = const <String>{}, - String? nullPlaceholder,
- CsvDateOrder dateOrder = CsvDateOrder.iso,
- Map<
String, int> monthNames = const {}, - bool trimFields = false,
- Map<
String, bool> boolValues = const <String, bool>{}, - dynamic decoderTransform()?,
- dynamic encoderTransform()?,
Create a CSV configuration.
All parameters have sensible defaults (RFC 4180 compatible). Named presets CsvConfig.excel, CsvConfig.tsv, CsvConfig.pipe are available for common formats.
Implementation
const CsvConfig({
this.fieldDelimiter = ',',
this.lineDelimiter = '\r\n',
this.quoteCharacter = '"',
String? escapeCharacter,
this.quoteMode = QuoteMode.necessary,
this.addBom = false,
this.autoDetect = true,
this.skipEmptyLines = true,
this.hasHeader = false,
this.dynamicTyping = true,
this.parseDates = false,
this.strict = false,
this.comment,
this.skipRows = 0,
this.maxRows,
this.skipInitialSpace = false,
this.nullValues = const <String>{},
this.nullPlaceholder,
this.dateOrder = CsvDateOrder.iso,
this.monthNames = const {},
this.trimFields = false,
this.boolValues = const <String, bool>{},
this.decoderTransform,
this.encoderTransform,
}) : escapeCharacter = escapeCharacter ?? quoteCharacter;