floatToTime12 method
Implementation
String floatToTime12(double time, {bool suffix = true}) {
if (time.isNaN) return InvalidTime;
time = fixhour(time + 0.5 / 60); // add 0.5 minutes to round
int hours = time.floor();
final int minutes = ((time - hours) * 60).floor();
final String suffixStr = suffix ? (hours >= 12 ? ' PM' : ' AM') : '';
hours = ((hours + 12 - 1) % 12 + 1);
return '$hours:${twoDigitsFormat(minutes)}$suffixStr';
}