generateMinutesOrSeconds function

List<int?> generateMinutesOrSeconds(
  1. int divisions,
  2. TimePickerInterval? interval,
  3. dynamic min,
  4. dynamic max,
)

Generate a List of minutes

Implementation

List<int?> generateMinutesOrSeconds(
  int divisions,
  TimePickerInterval? interval,
  min,
  max,
) {
  final minutes = List<int?>.generate(divisions + 1, (index) {
    final val =
        min.round() + (getIntFromTimePickerIntervalEnum(interval) * index);
    if (val >= max) {
      return max.round();
    }
    return val;
  });
  return minutes;
}