generateHours function

List<int?> generateHours(
  1. int divisions,
  2. dynamic min,
  3. dynamic max
)

Generate a List of hours

Implementation

List<int?> generateHours(int divisions, min, max) {
  final hours = List<int?>.generate(divisions, (index) {
    final val = min.round() + index;
    if (val >= max) {
      return max.round();
    }
    return val;
  });
  return hours;
}