Slot class

A reservable slot in the school's timetable.

Annotations

Constructors

Slot({required int id, @JsonKey(name: 'startunit') required SlotTimeUnit startUnit, required int duration, required Weekday weekday, required String room, required int size, @JsonKey(name: 'fullness') required int reservations, @JsonKey(name: 'forcuruser') required bool reserved, @Default([]) List<int> supervisors, @Default([]) @JsonKey(name: 'filters') List<CourseToSlot> mappings})
A reservable slot in the school's timetable.
const
factory
Slot.fromJson(Map<String, Object?> json)
Creates a Slot from json.
factory
Slot.noId({required SlotTimeUnit startUnit, required int duration, required Weekday weekday, required String room, required int size})
Creates a Slot without Slot.id, Slot.reservations, Slot.reserved and Slot.supervisors.
factory

Properties

copyWith → $SlotCopyWith<Slot>
Create a copy of Slot with the given fields replaced by the non-null parameter values.
no setterinherited
duration → int
The duration of this slot interpreted as SlotTimeUnits.
no setterinherited
endUnit → SlotTimeUnit
End time of this slot.
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → int
Unique identifier of this slot.
no setterinherited
mappings → List<CourseToSlot>
The course mappings of this slot.
no setterinherited
reservations → int
The number of students that have already reserved this slot.
no setterinherited
reserved → bool
true if the current user has reserved this slot.
no setterinherited
room → String
The room this slot takes place in.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
The number of students that can attend this slot.
no setterinherited
startUnit → SlotTimeUnit
The start time of this slot.
no setterinherited
supervisors → List<int>
The user ids of those supervising this slot.
no setterinherited
weekday → Weekday
The weekday this slot takes place on.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this Slot to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited