dateTimeFormat function

String dateTimeFormat(
  1. String format,
  2. DateTime? dateTime
)

Implementation

String dateTimeFormat(String format, DateTime? dateTime) {
  if (dateTime == null) {
    return '';
  }
  if (format == 'relative') {
    return timeago.format(dateTime);
  }
  return DateFormat(format).format(dateTime);
}