You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
4.4 KiB
Dart
149 lines
4.4 KiB
Dart
class SurveyModel {
|
|
int? surveyId;
|
|
String? referenceNo;
|
|
String? title;
|
|
String? description;
|
|
List<Questions>? questions;
|
|
bool? isActive;
|
|
Null? pageSize;
|
|
Null? pageNo;
|
|
Null? languageId;
|
|
|
|
SurveyModel({this.surveyId, this.referenceNo, this.title, this.description, this.questions, this.isActive, this.pageSize, this.pageNo, this.languageId});
|
|
|
|
SurveyModel.fromJson(Map<String, dynamic> json) {
|
|
surveyId = json['surveyId'];
|
|
referenceNo = json['referenceNo'];
|
|
title = json['title'];
|
|
description = json['description'];
|
|
if (json['questions'] != null) {
|
|
questions = <Questions>[];
|
|
json['questions'].forEach((v) {
|
|
questions!.add(new Questions.fromJson(v));
|
|
});
|
|
}
|
|
isActive = json['isActive'];
|
|
pageSize = json['pageSize'];
|
|
pageNo = json['pageNo'];
|
|
languageId = json['languageId'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['surveyId'] = this.surveyId;
|
|
data['referenceNo'] = this.referenceNo;
|
|
data['title'] = this.title;
|
|
data['description'] = this.description;
|
|
if (this.questions != null) {
|
|
data['questions'] = this.questions!.map((v) => v.toJson()).toList();
|
|
}
|
|
data['isActive'] = this.isActive;
|
|
data['pageSize'] = this.pageSize;
|
|
data['pageNo'] = this.pageNo;
|
|
data['languageId'] = this.languageId;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Questions {
|
|
int? questionId;
|
|
String? title;
|
|
bool? isRequired;
|
|
String? type;
|
|
int? sequenceNo;
|
|
Null? surveyId;
|
|
List<Options>? options;
|
|
Null? rspPercentage;
|
|
Null? isActive;
|
|
Null? pageSize;
|
|
Null? pageNo;
|
|
Null? languageId;
|
|
|
|
Questions({this.questionId, this.title, this.isRequired, this.type, this.sequenceNo, this.surveyId, this.options, this.rspPercentage, this.isActive, this.pageSize, this.pageNo, this.languageId});
|
|
|
|
Questions.fromJson(Map<String, dynamic> json) {
|
|
questionId = json['questionId'];
|
|
title = json['title'];
|
|
isRequired = json['isRequired'];
|
|
type = json['type'];
|
|
sequenceNo = json['sequenceNo'];
|
|
surveyId = json['surveyId'];
|
|
if (json['options'] != null) {
|
|
options = <Options>[];
|
|
json['options'].forEach((v) {
|
|
options!.add(new Options.fromJson(v));
|
|
});
|
|
}
|
|
rspPercentage = json['rspPercentage'];
|
|
isActive = json['isActive'];
|
|
pageSize = json['pageSize'];
|
|
pageNo = json['pageNo'];
|
|
languageId = json['languageId'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['questionId'] = this.questionId;
|
|
data['title'] = this.title;
|
|
data['isRequired'] = this.isRequired;
|
|
data['type'] = this.type;
|
|
data['sequenceNo'] = this.sequenceNo;
|
|
data['surveyId'] = this.surveyId;
|
|
if (this.options != null) {
|
|
data['options'] = this.options!.map((v) => v.toJson()).toList();
|
|
}
|
|
data['rspPercentage'] = this.rspPercentage;
|
|
data['isActive'] = this.isActive;
|
|
data['pageSize'] = this.pageSize;
|
|
data['pageNo'] = this.pageNo;
|
|
data['languageId'] = this.languageId;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Options {
|
|
int? optionId;
|
|
String? title;
|
|
bool? isCommentsRequired;
|
|
int? sequenceNo;
|
|
int? questionId;
|
|
Null? rspPercentage;
|
|
Null? count;
|
|
Null? isActive;
|
|
Null? pageSize;
|
|
Null? pageNo;
|
|
Null? languageId;
|
|
|
|
Options({this.optionId, this.title, this.isCommentsRequired, this.sequenceNo, this.questionId, this.rspPercentage, this.count, this.isActive, this.pageSize, this.pageNo, this.languageId});
|
|
|
|
Options.fromJson(Map<String, dynamic> json) {
|
|
optionId = json['optionId'];
|
|
title = json['title'];
|
|
isCommentsRequired = json['isCommentsRequired'];
|
|
sequenceNo = json['sequenceNo'];
|
|
questionId = json['questionId'];
|
|
rspPercentage = json['rspPercentage'];
|
|
count = json['count'];
|
|
isActive = json['isActive'];
|
|
pageSize = json['pageSize'];
|
|
pageNo = json['pageNo'];
|
|
languageId = json['languageId'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['optionId'] = this.optionId;
|
|
data['title'] = this.title;
|
|
data['isCommentsRequired'] = this.isCommentsRequired;
|
|
data['sequenceNo'] = this.sequenceNo;
|
|
data['questionId'] = this.questionId;
|
|
data['rspPercentage'] = this.rspPercentage;
|
|
data['count'] = this.count;
|
|
data['isActive'] = this.isActive;
|
|
data['pageSize'] = this.pageSize;
|
|
data['pageNo'] = this.pageNo;
|
|
data['languageId'] = this.languageId;
|
|
return data;
|
|
}
|
|
}
|