class SurveyModel { int? surveyId; String? referenceNo; String? title; String? description; List? 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 json) { surveyId = json['surveyId']; referenceNo = json['referenceNo']; title = json['title']; description = json['description']; if (json['questions'] != null) { questions = []; json['questions'].forEach((v) { questions!.add(new Questions.fromJson(v)); }); } isActive = json['isActive']; pageSize = json['pageSize']; pageNo = json['pageNo']; languageId = json['languageId']; } Map toJson() { Map data = new Map(); 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; 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 json) { questionId = json['questionId']; title = json['title']; isRequired = json['isRequired']; type = json['type']; sequenceNo = json['sequenceNo']; surveyId = json['surveyId']; if (json['options'] != null) { 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 toJson() { Map data = new Map(); 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 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 toJson() { Map data = new Map(); 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; } }