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.
89 lines
2.1 KiB
89 lines
2.1 KiB
class TestData {
|
|
String? id;
|
|
String? title;
|
|
int? type;
|
|
String? disclaimer;
|
|
List<QuestionList>? questionList;
|
|
|
|
TestData(
|
|
{this.id, this.title, this.type, this.disclaimer, this.questionList});
|
|
|
|
TestData.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
title = json['title'];
|
|
type = json['type'];
|
|
disclaimer = json['disclaimer'];
|
|
if (json['questionList'] != null) {
|
|
questionList = <QuestionList>[];
|
|
json['questionList'].forEach((v) {
|
|
questionList!.add(new QuestionList.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['id'] = this.id;
|
|
data['title'] = this.title;
|
|
data['type'] = this.type;
|
|
data['disclaimer'] = this.disclaimer;
|
|
if (this.questionList != null) {
|
|
data['questionList'] = this.questionList!.map((v) => v.toJson()).toList();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class QuestionList {
|
|
String? id;
|
|
String? title;
|
|
int? sort;
|
|
List<OptionList>? optionList;
|
|
|
|
QuestionList({this.id, this.title, this.sort, this.optionList});
|
|
|
|
QuestionList.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
title = json['title'];
|
|
sort = json['sort'];
|
|
if (json['optionList'] != null) {
|
|
optionList = <OptionList>[];
|
|
json['optionList'].forEach((v) {
|
|
optionList!.add(new OptionList.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['id'] = this.id;
|
|
data['title'] = this.title;
|
|
data['sort'] = this.sort;
|
|
if (this.optionList != null) {
|
|
data['optionList'] = this.optionList!.map((v) => v.toJson()).toList();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class OptionList {
|
|
String? id;
|
|
String? text;
|
|
int? sort;
|
|
|
|
OptionList({this.id, this.text, this.sort});
|
|
|
|
OptionList.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
text = json['text'];
|
|
sort = json['sort'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['id'] = this.id;
|
|
data['text'] = this.text;
|
|
data['sort'] = this.sort;
|
|
return data;
|
|
}
|
|
}
|