toJson method
jsonDecode(jsonStr) 方法中会调用实体类的这个方法。如果实体类中没有这个方法,会报错。
Implementation
Map toJson() {
Map map = new Map();
map["weekDay"] = this.weekDay;
map["startTime"] = this.startTime;
map["endTime"] = this.endTime;
return map;
}
jsonDecode(jsonStr) 方法中会调用实体类的这个方法。如果实体类中没有这个方法,会报错。
Map toJson() {
Map map = new Map();
map["weekDay"] = this.weekDay;
map["startTime"] = this.startTime;
map["endTime"] = this.endTime;
return map;
}