Add support for serialization to JSON
This commit is contained in:
parent
5f4f5d892f
commit
0ed3f745ae
1 changed files with 13 additions and 0 deletions
|
@ -30,4 +30,17 @@ class Course {
|
||||||
Course();
|
Course();
|
||||||
|
|
||||||
String toString() => title.isEmpty ? 'notitle' : title;
|
String toString() => title.isEmpty ? 'notitle' : title;
|
||||||
|
|
||||||
|
Map toJson() {
|
||||||
|
Map map = new Map();
|
||||||
|
map["title"] = title;
|
||||||
|
map["time"] = time;
|
||||||
|
map["day"] = day;
|
||||||
|
map["kind"] = kind;
|
||||||
|
map["place"] = place;
|
||||||
|
map["prof"] = prof;
|
||||||
|
map["turnin"] = turnin;
|
||||||
|
map["id"] = id;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue