HTime constructor

HTime(
  1. int hour,
  2. int min, [
  3. int sec = 0,
  4. int ms = 0,
])

Construct with all fields.

Implementation

factory HTime(int hour, int min, [int sec = 0, int ms = 0]) {
  if (hour < 0 || hour > 23) throw FormatException('Invalid hour', hour);
  if (min < 0 || min > 59) throw FormatException('Invalid min', min);
  if (sec < 0 || sec > 59) throw FormatException('Invalid sec', sec);
  if (ms < 0 || ms > 999) throw FormatException('Invalid ms', ms);
  return HTime._(hour, min, sec, ms);
}