mobileApplicationsKonectarApp/lib/model/save_interaction.dart

144 lines
3.5 KiB
Dart
Raw Permalink Normal View History

2024-01-04 07:06:37 +00:00
// To parse this JSON data, do
//
// final welcome = welcomeFromJson(jsonString);
import 'dart:convert';
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<SaveInteraction> data;
SendSavedDataJson({required this.data});
Map<String, dynamic> toJson() => {
"data": List<SaveInteraction>.from(data.map((x) => x.toJson())),
};
}
@HiveType(typeId: 3)
class SaveInteraction {
@HiveField(0)
String id;
@HiveField(1)
List<FormFieldData> 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<String, dynamic> json) =>
SaveInteraction(
save: List<FormFieldData>.from(
json["save"].map((x) => SaveData.fromJson(x))),
intId: 'intId',
intName: 'intName',
id: 'id');
Map<String, dynamic> toJson() => {
"save": List<FormFieldData>.from(save.map((x) => x.toJson())),
};
Map<String, dynamic> savetoJson() => {
"form": form,
"intId": intId,
};
}
class JsonFormat {}
class SaveInteractionJson {
@HiveField(0)
int? id;
@HiveField(1)
List<SaveData> save;
SaveInteractionJson({
required this.save,
});
factory SaveInteractionJson.fromJson(Map<String, dynamic> json) =>
SaveInteractionJson(
save:
List<SaveData>.from(json["save"].map((x) => SaveData.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"save": List<dynamic>.from(save.map((x) => x.toJson())),
};
}
class SaveData {
String sectionName;
List<dynamic> multiple;
List<SaveSectionList> sectionList;
List<List<SaveSectionList>>? multiplesectionList;
SaveData({
required this.sectionName,
required this.multiple,
required this.sectionList,
this.multiplesectionList,
});
factory SaveData.fromJson(Map<String, dynamic> json) => SaveData(
sectionName: json["sectionName"],
multiple: List<dynamic>.from(json["multiple"].map((x) => x)),
sectionList: List<SaveSectionList>.from(
json["sectionList"].map((x) => SaveSectionList.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"sectionName": sectionName,
"multiple": List<dynamic>.from(multiple.map((x) => x)),
"sectionList": List<dynamic>.from(sectionList.map((x) => x.toJson())),
};
}
class SaveSectionList {
String param;
String id;
List<dynamic> selectedValue;
String? widget;
SaveSectionList({
required this.param,
required this.id,
required this.selectedValue,
this.widget,
});
factory SaveSectionList.fromJson(Map<String, dynamic> json) =>
SaveSectionList(
param: json["param"],
id: json["id"],
selectedValue: List<dynamic>.from(json["selectedValue"].map((x) => x)),
widget: json["widget"],
);
Map<String, dynamic> toJson() => {
"param": param,
"id": id,
"selectedValue": List<dynamic>.from(selectedValue.map((x) => x)),
"widget": widget,
};
}