timeOfDayToString function

String timeOfDayToString(
  1. DateTime time
)

converts a DateTime object to a formatted time string

Implementation

String timeOfDayToString(DateTime time) {
  var minute = time.minute;
  if (minute < 10) return '${time.hour}: 0${time.minute}';

  return '${time.hour}: ${time.minute}';
}