add method

TimeOfDay add({
  1. int hour = 0,
  2. int minute = 0,
})

Implementation

TimeOfDay add({int hour = 0, int minute = 0}) {
  int newMinute = this.minute + minute;
  int newHour = this.hour + hour + (newMinute ~/ 60);
  newMinute = newMinute % 60;

  newHour = newHour % 24;

  return replacing(hour: newHour, minute: newMinute);
}