getMinuteDivisions function

int getMinuteDivisions(
  1. int diff,
  2. MinuteInterval? interval
)

Map MinuteInterval enum to division values

Implementation

int getMinuteDivisions(int diff, MinuteInterval? interval) {
  switch (interval) {
    case MinuteInterval.FIVE:
      // 12
      return (diff / 5).round();
    case MinuteInterval.TEN:
      // 6
      return (diff / 10).round();
    case MinuteInterval.FIFTEEN:
      // 4
      return (diff / 15).round();
    case MinuteInterval.THIRTY:
      // 2
      return (diff / 30).round();
    default:
      return diff;
  }
}