generateMinutes function

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

Generate a List of minutes

Implementation

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