getMinMinute function

double getMinMinute(
  1. double? minMinute,
  2. MinuteInterval? interval
)

Get the minimum minute from interval

Implementation

double getMinMinute(double? minMinute, MinuteInterval? interval) {
  if (minMinute == 0) {
    return 0;
  }
  int step = getIntFromMinuteIntervalEnum(interval);

  double min = -1;
  double i = 1;
  while (min < 0) {
    double val = i * step;
    if (val >= minMinute!) {
      min = val;
    }
    i++;
  }
  return min;
}