time12h property
String
get
time12h
Returns the time in 12-hour format with AM/PM "HH:MM AM/PM"
Implementation
String get time12h {
int h = hour % 12 == 0 ? 12 : hour % 12;
String period = hour < 12 ? "AM" : "PM";
return "$h:${_twoDigits(minute)} $period";
}