// To parse this JSON data, do // // final welcome = welcomeFromJson(jsonString); import 'dart:convert'; import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:hive_flutter/hive_flutter.dart'; // import 'package:pwa_ios/model/interaction_data.dart'; part 'save_interaction.g.dart'; SaveInteraction welcomeFromJson(String str) => SaveInteraction.fromJson(json.decode(str)); String welcomeToJson(SaveInteraction data) => json.encode(data.toJson()); class SendSavedDataJson { List data; SendSavedDataJson({required this.data}); Map toJson() => { "data": List.from(data.map((x) => x.toJson())), }; } @HiveType(typeId: 3) class SaveInteraction { @HiveField(0) String id; @HiveField(1) List save; @HiveField(2) String? form; @HiveField(3) String? updatedTime; @HiveField(4) String intId; @HiveField(5) String intName; SaveInteraction( {required this.save, required this.id, this.form, this.updatedTime, required this.intId, required this.intName}); factory SaveInteraction.fromJson(Map json) => SaveInteraction( save: List.from( json["save"].map((x) => SaveData.fromJson(x))), intId: 'intId', intName: 'intName', id: 'id'); Map toJson() => { "save": List.from(save.map((x) => x.toJson())), }; Map savetoJson() => { "form": form, "intId": intId, }; } class JsonFormat {} class SaveInteractionJson { @HiveField(0) int? id; @HiveField(1) List save; SaveInteractionJson({ required this.save, }); factory SaveInteractionJson.fromJson(Map json) => SaveInteractionJson( save: List.from(json["save"].map((x) => SaveData.fromJson(x))), ); Map toJson() => { "save": List.from(save.map((x) => x.toJson())), }; } class SaveData { String sectionName; List multiple; List sectionList; List>? multiplesectionList; SaveData({ required this.sectionName, required this.multiple, required this.sectionList, this.multiplesectionList, }); factory SaveData.fromJson(Map json) => SaveData( sectionName: json["sectionName"], multiple: List.from(json["multiple"].map((x) => x)), sectionList: List.from( json["sectionList"].map((x) => SaveSectionList.fromJson(x))), ); Map toJson() => { "sectionName": sectionName, "multiple": List.from(multiple.map((x) => x)), "sectionList": List.from(sectionList.map((x) => x.toJson())), }; } class SaveSectionList { String param; String id; List selectedValue; String? widget; SaveSectionList({ required this.param, required this.id, required this.selectedValue, this.widget, }); factory SaveSectionList.fromJson(Map json) => SaveSectionList( param: json["param"], id: json["id"], selectedValue: List.from(json["selectedValue"].map((x) => x)), widget: json["widget"], ); Map toJson() => { "param": param, "id": id, "selectedValue": List.from(selectedValue.map((x) => x)), "widget": widget, }; }