range static method

List<TimeOfDay> range(
  1. TimeOfDay start,
  2. TimeOfDay end, {
  3. int stepMinutes = 30,
})

Implementation

static List<TimeOfDay> range(
  TimeOfDay start,
  TimeOfDay end, {
  int stepMinutes = 30,
}) {
  final times = <TimeOfDay>[];
  var current = start;
  while (current.isBefore(end) || current.isAtSameTime(end)) {
    times.add(current);
    current = current.addMinutes(stepMinutes);
  }
  return times;
}