formatDate function Null safety

String formatDate(
  1. DateTime dateTime
)

Format DateTime and return a String having this format : MM/dd/y

Implementation

String formatDate(DateTime dateTime) {
  return DateFormat('MM/dd/y').format(dateTime);
}