Slot constructor

const Slot({
  1. required int id,
  2. @JsonValue('startunit') required SlotTimeUnit startUnit,
  3. required int duration,
  4. required Weekday weekday,
  5. required String room,
  6. required int size,
  7. @JsonValue('fullness') required int reservations,
  8. @JsonValue('forcuruser') required bool reserved,
  9. @Default([]) List<int> supervisors,
})

A reservable slot in the school's timetable.

Implementation

const factory Slot({
  /// Unique identifier of this slot.
  required int id,

  /// The start time of this slot.
  @JsonValue('startunit') required SlotTimeUnit startUnit,

  /// The duration of this slot interpreted as [SlotTimeUnit]s.
  required int duration,

  /// The weekday this slot takes place on.
  required Weekday weekday,

  /// The room this slot takes place in.
  required String room,

  /// The number of students that can attend this slot.
  required int size,

  /// The number of students that have already reserved this slot.
  @JsonValue('fullness') required int reservations,

  /// `true` if the current user has reserved this slot.
  @JsonValue('forcuruser') required bool reserved,

  /// The user ids of those supervising this slot.
  @Default([]) List<int> supervisors,
}) = _Slot;