toTimeString method
Format DateTime to toTimeString - HH:mm or HH:mm:ss
Implementation
String? toTimeString({bool withSeconds = false}) {
if (this == null) return null;
String format = "HH:mm";
if (withSeconds) format = "HH:mm:ss";
return intl.DateFormat(format, _locale).format(this!);
}