dateTimeFormat method Null safety

String dateTimeFormat(
  1. DateTime? date,
  2. [String? separator]
)

Implementation

static String dateTimeFormat(DateTime? date, [String? separator]) {
  if (date == null) {
    return "";
  }
  return dateFormat.format(date) +
      " ${separator ?? 'às'} " +
      timeFormat.format(date) +
      " hrs";
}