format static method

String format(
  1. String type,
  2. Object value,
  3. String? format,
  4. String? locale,
)

Implementation

static String format(
    String type, Object value, String? format, String? locale) {
  type = type.toLowerCase();
  final formatter = all.firstWhere(
    (x) => x.type.any((t) => t == type),
    orElse: () => const StringFormatter(),
  );
  return formatter.format(value, format, locale);
}