Time constructor

Time(
  1. int hour, [
  2. int minute = 0,
  3. int second = 0,
  4. int millisecond = 0,
  5. int microsecond = 0,
])

Creates a Time with the given time units.

Implementation

Time(this.hour, [this.minute = 0, this.second = 0, this.millisecond = 0, this.microsecond = 0]):
      assert(hour >= 0 && hour < 24, 'Hour is "$hour", should be between 0 and 24'),
      assert(minute >= 0 && minute < 60, 'Minute is "$minute", should be between 0 and 60'),
      assert(second >= 0 && second < 60, 'Second is "$second", should be between 0 and 60'),
      assert(millisecond >= 0 && millisecond < 1000, 'Millisecond is "$millisecond", should be between 0 and 1000'),
      assert(microsecond >= 0 && microsecond < 1000, 'Microsecond is "$microsecond", should be between 0 and 1000');