dateFormatDatetime2 static method

String dateFormatDatetime2({
  1. required DateTime? time,
  2. String? content,
})

Implementation

static String dateFormatDatetime2({required DateTime? time, String? content}) {
  if (time != null) {
    return DateFormat('hh:mm a').format(time);
  } else {
    return "$content";
  }
}