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.
aku_new_community/lib/model/manager/questionnaire_detail_model....

119 lines
3.4 KiB

3 years ago
import 'package:aku_new_community/model/common/img_model.dart';
class QuestionnaireDetialModel {
4 years ago
int? id;
String? title;
String? description;
String? beginDate;
String? endDate;
List<QuestionnaireTopicVoList>? questionnaireTopicVoList;
List<ImgModel>? voResourcesImgList;
QuestionnaireDetialModel(
{this.id,
this.title,
this.description,
this.beginDate,
this.endDate,
this.questionnaireTopicVoList,
this.voResourcesImgList});
QuestionnaireDetialModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
description = json['description'];
beginDate = json['beginDate'];
endDate = json['endDate'];
if (json['questionnaireTopicVoList'] != null) {
4 years ago
questionnaireTopicVoList = [];
json['questionnaireTopicVoList'].forEach((v) {
4 years ago
questionnaireTopicVoList!.add(new QuestionnaireTopicVoList.fromJson(v));
});
}
if (json['voResourcesImgList'] != null) {
4 years ago
voResourcesImgList = [];
json['voResourcesImgList'].forEach((v) {
4 years ago
voResourcesImgList!.add(new ImgModel.fromJson(v));
});
} else
voResourcesImgList = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['description'] = this.description;
data['beginDate'] = this.beginDate;
data['endDate'] = this.endDate;
if (this.questionnaireTopicVoList != null) {
data['questionnaireTopicVoList'] =
4 years ago
this.questionnaireTopicVoList!.map((v) => v.toJson()).toList();
}
if (this.voResourcesImgList != null) {
data['voResourcesImgList'] =
4 years ago
this.voResourcesImgList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class QuestionnaireTopicVoList {
4 years ago
int? id;
int? type;
String? topic;
List<QuestionnaireChoiceVoList>? questionnaireChoiceVoList;
QuestionnaireTopicVoList(
{this.id, this.type, this.topic, this.questionnaireChoiceVoList});
QuestionnaireTopicVoList.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
topic = json['topic'];
if (json['questionnaireChoiceVoList'] != null) {
4 years ago
questionnaireChoiceVoList = [];
json['questionnaireChoiceVoList'].forEach((v) {
4 years ago
questionnaireChoiceVoList!
.add(new QuestionnaireChoiceVoList.fromJson(v));
});
} else
questionnaireChoiceVoList = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['topic'] = this.topic;
if (this.questionnaireChoiceVoList != null) {
data['questionnaireChoiceVoList'] =
4 years ago
this.questionnaireChoiceVoList!.map((v) => v.toJson()).toList();
} else
questionnaireChoiceVoList = [];
return data;
}
}
class QuestionnaireChoiceVoList {
4 years ago
int? id;
String? options;
String? answer;
QuestionnaireChoiceVoList({this.id, this.options, this.answer});
QuestionnaireChoiceVoList.fromJson(Map<String, dynamic> json) {
id = json['id'];
options = json['options'];
answer = json['answer'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['options'] = this.options;
data['answer'] = this.answer;
return data;
}
}