@@ -4,6 +4,8 @@ import 'util.dart';
4
4
/// The actual excuse for an [UntisAbsence] , it contains a reference
5
5
/// to a [UntisExcuseStatus] .
6
6
class UntisExcuse {
7
+ UntisExcuse ._(this .id, this .excuseStatus, this .text, this .number, this .date);
8
+
7
9
/// ID to track this individual excuse
8
10
final int id;
9
11
@@ -19,8 +21,6 @@ class UntisExcuse {
19
21
/// The date for when this excuse is valid
20
22
final DateTime date;
21
23
22
- UntisExcuse ._(this .id, this .excuseStatus, this .text, this .number, this .date);
23
-
24
24
/// Parses this object from [json]
25
25
static Future <UntisExcuse > fromJson (
26
26
UntisSession s, Map <String , dynamic > json) async {
@@ -40,6 +40,14 @@ class UntisExcuse {
40
40
/// This is a general status, that can be used with every [UntisExcuse] .
41
41
/// [UntisExcuse] is the concrete excuse, which contains a reference to this
42
42
class UntisExcuseStatus {
43
+ /// Parses this object from [json]
44
+ UntisExcuseStatus .fromJson (Map <String , dynamic > json)
45
+ : id = json['id' ],
46
+ name = json['name' ],
47
+ longName = json['longName' ],
48
+ excused = json['excused' ],
49
+ active = json['active' ];
50
+
43
51
/// ID for referred to from a [UntisExcuse]
44
52
final int id;
45
53
@@ -54,14 +62,6 @@ class UntisExcuseStatus {
54
62
55
63
/// Unknown what this is, always true?
56
64
final bool active;
57
-
58
- /// Parses this object from [json]
59
- UntisExcuseStatus .fromJson (Map <String , dynamic > json)
60
- : id = json['id' ],
61
- name = json['name' ],
62
- longName = json['longName' ],
63
- excused = json['excused' ],
64
- active = json['active' ];
65
65
}
66
66
67
67
/// An absence of a student
@@ -70,6 +70,19 @@ class UntisExcuseStatus {
70
70
/// Additionally contains [UntisAbsenceReason] and sometimes a title,
71
71
/// for example for a school event.
72
72
class UntisAbsence {
73
+ UntisAbsence ._(
74
+ this .id,
75
+ this .studentId,
76
+ this .classId,
77
+ this .startDateTime,
78
+ this .endDateTime,
79
+ this .owner,
80
+ this .excused,
81
+ this .excuse,
82
+ this .reason,
83
+ this .reasonText,
84
+ this .text);
85
+
73
86
/// ID for the individual absence
74
87
final int id;
75
88
@@ -103,19 +116,6 @@ class UntisAbsence {
103
116
/// A title for the absence, for example the title of a school event
104
117
final String text;
105
118
106
- UntisAbsence ._(
107
- this .id,
108
- this .studentId,
109
- this .classId,
110
- this .startDateTime,
111
- this .endDateTime,
112
- this .owner,
113
- this .excused,
114
- this .excuse,
115
- this .reason,
116
- this .reasonText,
117
- this .text);
118
-
119
119
/// Parses this object from [json]
120
120
static Future <UntisAbsence > fromJson (
121
121
UntisSession s, Map <String , dynamic > json) async {
@@ -145,6 +145,13 @@ class UntisAbsence {
145
145
/// This can be illness, school event, furlough(granted vacation), delay
146
146
/// This is a necessity for [UntisAbsence] , but [UntisExcuseStatus] is not.
147
147
class UntisAbsenceReason {
148
+ /// Parses this object from [json]
149
+ UntisAbsenceReason .fromJson (Map <String , dynamic > json)
150
+ : id = json['id' ],
151
+ name = json['name' ],
152
+ longName = json['longName' ],
153
+ active = json['active' ];
154
+
148
155
/// ID for referred to from a [UntisAbsence]
149
156
final int id;
150
157
@@ -156,11 +163,4 @@ class UntisAbsenceReason {
156
163
157
164
/// Unknown what this is, always true?
158
165
final bool active;
159
-
160
- /// Parses this object from [json]
161
- UntisAbsenceReason .fromJson (Map <String , dynamic > json)
162
- : id = json['id' ],
163
- name = json['name' ],
164
- longName = json['longName' ],
165
- active = json['active' ];
166
166
}
0 commit comments