getDivisions function
Map MinuteInterval enum to division values
Implementation
int getDivisions(int diff, TimePickerInterval? interval) {
switch (interval) {
case TimePickerInterval.FIVE:
// 12
return (diff / 5).round();
case TimePickerInterval.TEN:
// 6
return (diff / 10).round();
case TimePickerInterval.FIFTEEN:
// 4
return (diff / 15).round();
case TimePickerInterval.THIRTY:
// 2
return (diff / 30).round();
default:
return diff;
}
}