dateToString static method

String dateToString(
  1. DateTime date, {
  2. String? pattern,
  3. String? locale,
})

Implementation

static String dateToString(DateTime date,
    {String? pattern, String? locale}) {
  locale ??= Constants().localeEN;
  pattern ??= 'yyyy.MM.dd';
  initializeDateFormatting(locale, null);
  return DateFormat(pattern, locale).format(date);
}