How to make your app create a list automatically

I’m working on an application for the exchange and booking of services. I’ve reached a point where it is necessary for the user who offers services to be able to set rules for the start time, end time, and an average duration for each service. This way, the user who books the service will have the necessary rules to generate a list of available time slots, which are then updated based on availability saved in Firebase.

To explain it better:

  • Start time: 9:00 AM
  • End time: 1:00 PM
  • Average service duration: 30 minutes

Once the professional saves this information in the database, when their profile is viewed, a list should be generated with time slots like 9:00, 9:30, 10:00, 10:30, etc. These slots should be either highlighted in red or crossed out if a booking already exists or if that specific time on that day is marked as ‘booked’ or something similar.

The problem is that I have no idea how to insert the elements into an app variable: empty list to then update the Simple List Viewer, or rather, what the best method is to achieve the desired result.

I hope I explained myself well, thanks in advance for your help!