Add support for serialization to JSON

This commit is contained in:
Marcel Kapfer (mmk2410) 2016-06-25 10:42:43 +02:00
parent 5f4f5d892f
commit 0ed3f745ae
1 changed files with 13 additions and 0 deletions

View File

@ -30,4 +30,17 @@ class Course {
Course();
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;
}
}