// To parse this JSON data, do // // final saveInteractionFormJson = saveInteractionFormJsonFromJson(jsonString); import 'dart:convert'; import 'package:hive_flutter/hive_flutter.dart'; part 'json_form_data.g.dart'; SaveInteractionFormJson saveInteractionFormJsonFromJson(String str) => SaveInteractionFormJson.fromJson(json.decode(str)); String saveInteractionFormJsonToJson(DataJson data) => json.encode(data.toJson()); String saveFormJsonToJson(SendSaveJson data) => json.encode(data.toJson()); class DataJson { SendSaveJson sendSaveJson; DataJson({required this.sendSaveJson}); factory DataJson.fromJson(Map json) => DataJson( sendSaveJson: json["data"], ); Map toJson() => { "data": sendSaveJson, }; } @HiveType(typeId: 14) class SendSaveJson { @HiveField(0) List savedList; SendSaveJson({required this.savedList}); factory SendSaveJson.fromJson(Map json) => SendSaveJson( savedList: List.from( json["data"].map((x) => SaveInteractionFormJson.fromJson(x))), ); Map toJson() => { "data": List.from(savedList.map((x) => x.toJson())), }; } @HiveType(typeId: 15) class SaveInteractionFormJson { @HiveField(0) String interactionForm1; @HiveField(1) String intId; @HiveField(2) String intName; @HiveField(3) List save; SaveInteractionFormJson({ required this.interactionForm1, required this.intId, required this.intName, required this.save, }); factory SaveInteractionFormJson.fromJson(Map json) => SaveInteractionFormJson( interactionForm1: json["Interaction-form1"], intId: json["intId"], intName: json["intName"], save: List.from(json["data"].map((x) => Save.fromJson(x))), ); Map toJson() => { "id": intId, "page": intName, "data": List.from(save.map((x) => x.toJson())), }; } @HiveType(typeId: 16) class Save { @HiveField(0) String sectionName; @HiveField(1) List> multipleSectionList; Save({ required this.sectionName, required this.multipleSectionList, }); factory Save.fromJson(Map json) => Save( sectionName: json["sectionName"], multipleSectionList: List>.from( json["multipleSectionList"].map((x) => List.from( x.map((x) => MultipleSectionList.fromJson(x))))), ); Map toJson() => { "sectionName": sectionName, "multipleSectionList": List.from(multipleSectionList .map((x) => List.from(x.map((x) => x.toJson())))), }; } @HiveType(typeId: 17) class MultipleSectionList { @HiveField(0) String id; @HiveField(1) List selectedValue; @HiveField(2) List? fileName; @HiveField(3) List? extension; MultipleSectionList( {required this.id, required this.selectedValue, this.extension, this.fileName}); factory MultipleSectionList.fromJson(Map json) => MultipleSectionList( id: json["id"], selectedValue: List.from(json["selectedValue"].map((x) => x)), ); Map toJson() => { "id": id, "selectedValue": List.from(selectedValue.map((x) => x)), "extension": extension != null ? List.from(extension!.map((x) => x)) : [], "fileName": fileName != null ? List.from(fileName!.map((x) => x)) : [], }; }