fromApi static method
Backward-compatible alias for API string formatting.
Implementation
static String fromApi(
String? value, {
String outputPattern = defaultFormat,
List<String> inputPatterns = apiInputFormats,
String fallbackValue = fallback,
String? locale,
bool toLocal = true,
}) {
final parsed = parse(
value,
inputPatterns: inputPatterns,
toLocal: toLocal,
);
if (parsed == null) {
return fallbackValue;
}
return formatDate(parsed, format: outputPattern, locale: locale);
}