formatDate static method

String formatDate(
  1. BuildContext context,
  2. DateTime value, {
  3. required DraftModePlatformStyle style,
})

Implementation

static String formatDate(
  BuildContext context,
  DateTime value, {
  required DraftModePlatformStyle style,
}) {
  final locale = Localizations.localeOf(context).toLanguageTag();
  if (style.isAndroid) {
    return DateFormat.yMMMd(locale).format(value);
  }
  return DateFormat(_paddedDatePattern(locale), locale).format(value);
}