format method
Format a string with ICU syntax.
See the ICU User Guide for more information.
The args
parameter is a map of arguments to be used in the string.
The locale
parameter is the locale to be used in the formatting. If not specified, the default locale is used.
Returns the formatted string.
Implementation
String format(Map<string, Object> args, [String? locale]) {
if (isBlank) {
return blankIfNull;
}
final messageFormat = MessageFormat(this!, locale: locale ?? "en");
return messageFormat.format(args);
}