getMax function

double getMax(
  1. double? maxMinute,
  2. TimePickerInterval? interval
)

Get the maximum minute from interval

Implementation

double getMax(double? maxMinute, TimePickerInterval? interval) {
  if (maxMinute == 59) {
    return 59;
  }
  int step = getIntFromTimePickerIntervalEnum(interval);

  double max = 60;
  double i = 1;
  while (max > maxMinute!) {
    double val = 60 - (i * step);
    if (val <= maxMinute) {
      max = val;
    }
    i++;
  }
  return max;
}