PerfTestFormat constructor
PerfTestFormat({
- String? borderFormat = '+-',
- String lineFormat = '| $stubFieldName | $stubFieldRatio | $stubFieldValue |',
- num? infinity = 9999.99,
- bool isQuiet = false,
- bool isRaw = false,
- PerfTestPrinter printer = print,
- String quote = '"',
- String quoteEscaped = '""',
- bool usePercent = false,
- DateFormat? dateFormat,
- NumberFormat? numberFormat,
- NumberFormat? percentFormat,
The constructor
Implementation
PerfTestFormat(
{String? borderFormat = '+-',
this.lineFormat =
'| $stubFieldName | $stubFieldRatio | $stubFieldValue |',
this.infinity = 9999.99,
this.isQuiet = false,
this.isRaw = false,
this.printer = print,
this.quote = '"',
this.quoteEscaped = '""',
this.usePercent = false,
DateFormat? dateFormat,
NumberFormat? numberFormat,
NumberFormat? percentFormat}) {
if ((borderFormat != null) && borderFormat.isNotEmpty) {
cornerChar = borderFormat[0];
horBarChar = borderFormat[borderFormat.length - 1];
} else {
cornerChar = '';
horBarChar = '';
}
this.dateFormat = dateFormat ?? DateFormat();
this.numberFormat = numberFormat ?? NumberFormat();
if (percentFormat != null) {
this.percentFormat = percentFormat;
} else if (usePercent) {
this.percentFormat = NumberFormat.percentPattern();
} else {
this.percentFormat = NumberFormat('#,##0.00');
}
final nonStub = lineFormat.replaceAll(stubRE, '');
fieldSeparator = (nonStub.isEmpty ? ' ' : nonStub[0]);
}