parseNumber method
Coerces the String value of the MaterialInput
into type of T
.
Implementation
@override
Int64? parseNumber(String? input) {
if (input == null || input.isEmpty) {
return null;
}
try {
// If using formatting, we must firsrt parse back to a non-formatted
// String representation as Int64 cannot handle commas.
if (_numberFormat != null) {
input = _numberFormat!.parse(input).toString();
}
return Int64.parseInt(input);
} on FormatException {
return null;
}
}