timeOfDayToString static method
convert time (TimeOfDay to String)
Implementation
static String timeOfDayToString(
{required TimeOfDay time,
bool hasSeconds = true,
String format = Format.fHHmmss}) {
int hour = time.hour;
String hourWithLeadingZero = leadingZero(hour);
String minuteWithLeadingZero = leadingZero(time.minute);
if (hasSeconds) {
String second = DateTimes.getCurrentDateTime(format: Format.fss);
return "$hourWithLeadingZero:$minuteWithLeadingZero:$second";
} else {
return "$hourWithLeadingZero:$minuteWithLeadingZero:00";
}
}