I'm trying to create a list of time slots for building an appointment-related app. For example, build-time slots from 8 AM TO 10 PM with a 30-minute gap between each interval. I'm trying to achieve the result using the flutter/dart DateTime class
DateTime now = DateTime.now();
DateTime startTime = DateTime(now.year, now.month, now.day, 8, 0, 0);
DateTime endTime = DateTime(now.year, now.month, now.day, 22, 0, 0);
Duration step = Duration(minutes: 30);
List timeSlots = ['8:30','9:00','9:30']; // this is what I'm trying to achieve (final output)
Any help would be appriciated