format method
Formats the given value
with the formatter.
Implementation
String format(Object value) {
switch (formatter) {
case NumberFormat formatter:
return formatter.format(value as num);
case DateFormat formatter:
return formatter.format(value as DateTime);
default:
throw Exception('Unknown formatter: $formatter');
}
}