toDateText function

String toDateText(
  1. DateTime? dateTime, {
  2. String defaultValue = '',
  3. String prefix = '',
  4. String separator = ',',
})

Implementation

String toDateText(DateTime? dateTime,
    {String defaultValue = '', String prefix = '', String separator = ','}) {
  if (dateTime == null) return defaultValue;
  return '$prefix${dateTime.day} ${getShortMonthText(dateTime.month)}$separator ${dateTime.year}';
}