From 0ed3f745ae3c69f66e8cc2fba97ac39e62268f02 Mon Sep 17 00:00:00 2001 From: "Marcel Kapfer (mmk2410)" Date: Sat, 25 Jun 2016 10:42:43 +0200 Subject: [PATCH] Add support for serialization to JSON --- lib/common/messages.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/common/messages.dart b/lib/common/messages.dart index 981a0ea..3a20ca9 100644 --- a/lib/common/messages.dart +++ b/lib/common/messages.dart @@ -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; + } }