Added api for custom timetable events
This commit is contained in:
23
lib/view/pages/timetable/arbitraryAppointment.dart
Normal file
23
lib/view/pages/timetable/arbitraryAppointment.dart
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
import '../../../api/mhsl/customTimetableEvent/customTimetableEvent.dart';
|
||||
import '../../../api/webuntis/queries/getTimetable/getTimetableResponse.dart';
|
||||
|
||||
class ArbitraryAppointment {
|
||||
GetTimetableResponseObject? webuntis;
|
||||
CustomTimetableEvent? custom;
|
||||
|
||||
ArbitraryAppointment({this.webuntis, this.custom}) {}
|
||||
|
||||
bool hasWebuntis() {
|
||||
return webuntis != null;
|
||||
}
|
||||
|
||||
bool hasCustom() {
|
||||
return custom != null;
|
||||
}
|
||||
|
||||
void handlers(void Function(GetTimetableResponseObject webuntisData) webuntis, void Function(CustomTimetableEvent customData) custom) {
|
||||
if(hasWebuntis()) webuntis(this.webuntis!);
|
||||
if(hasCustom()) custom(this.custom!);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user