formatWith method
String?
formatWith(
{ - String? zero,
- String? zeroReplace,
- String? one,
- String? oneReplace,
- String? many,
- String? manyReplace,
- String? other,
- String? otherReplace,
- String? all,
- String? allReplace,
})
Implementation
String? formatWith({
String? zero,
String? zeroReplace,
String? one,
String? oneReplace,
String? many,
String? manyReplace,
String? other,
String? otherReplace,
String? all,
String? allReplace,
}) =>
toInt().mapTo(
(int it) => it == 0
? allReplace ??
zeroReplace ??
(zero ?? other ?? all)?.pre(formatted, between: " ") ??
otherReplace
: it == 1
? allReplace ??
oneReplace ??
(one ?? other ?? all)?.pre(formatted, between: " ") ??
otherReplace
: it > 1
? allReplace ??
manyReplace ??
(many ?? other ?? all)?.pre(formatted, between: " ") ??
otherReplace
: allReplace ??
otherReplace ??
(other ?? all)?.pre(formatted, between: " "),
);