formatHour static method
Implementation
static String formatHour(int hour, bool isAmPm) {
if (!isAmPm) return hour.toString().padLeft(2, '0');
if (hour == 0) return '12';
if (hour > 12) return (hour - 12).toString();
return hour.toString();
}