You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

// Project imports:
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
import 'package:aku_community_manager/models/todo_bussiness/todo_outdoor_model.dart';
class ToDoModel {
dynamic dynamicModel;
int type;
ToDoModel({this.dynamicModel, this.type});
ToDoModel.fromJson(Map<String, dynamic> json) {
type = json['type'];
switch (type) {
case 1:
dynamicModel = json['dataList'] != null
? new BussinessAndFixModel.fromJson(json['dataList'])
: null;
break;
case 2:
dynamicModel = json['dataList'] != null
? new ToDoOutDoorModel.fromJson(json['dataList'])
: null;
break;
default:
dynamicModel = [];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.dynamicModel != null) {
data['dataList'] = this.dynamicModel.toJson();
}
data['type'] = this.type;
return data;
}
}