DiscoverModule/lib/ui_screen/interactionform/model/interaction_config_data.dart

122 lines
3.0 KiB
Dart

// 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 'interaction_config_data.g.dart';
// class UIDataResponse {
// bool success;
// String message;
// List<FormFieldData> formFields;
// UIDataResponse({
// required this.success,
// required this.message,
// required this.formFields,
// });
// factory UIDataResponse.fromJson(Map<String, dynamic> json) => UIDataResponse(
// success: json["success"],
// message: json["message"],
// formFields: List<FormFieldData>.from(
// json["data"].map((x) => FormFieldData.fromJson(x))),
// );
// Map<String, dynamic> toJson() => {
// "success": success,
// "message": message,
// "form-fields": List<dynamic>.from(formFields.map((x) => x.toJson())),
// };
// @override
// String toString() {
// // TODO: implement toString
// return List<dynamic>.from(formFields.map((x) => x.toJson())).toString();
// }
// }
// @HiveType(typeId: 19)
// class InteractionConfigData {
// @HiveField(1)
// InteractionResultData widgets;
// @HiveField(2)
// String id;
// @HiveField(3)
// String name;
// InteractionConfigData({
// required this.widgets,
// required this.id,
// required this.name,
// });
// Map<String, dynamic> toJson() => {"widgets": widgets};
// }
//pooja
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 'interaction_config_data.g.dart';
class UIDataResponse {
bool success;
String message;
List<FormFieldData> formFields;
String? formtype;
UIDataResponse({
required this.success,
required this.message,
required this.formFields,
this.formtype,
});
factory UIDataResponse.fromJson(Map<String, dynamic> json) => UIDataResponse(
success: json["success"],
message: json["message"],
formtype: json["formtype"],
formFields: List<FormFieldData>.from(
json["data"].map((x) => FormFieldData.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"success": success,
"message": message,
"formtype": formtype,
"form-fields": List<dynamic>.from(formFields.map((x) => x.toJson())),
};
@override
String toString() {
// TODO: implement toString
return List<dynamic>.from(formFields.map((x) => x.toJson())).toString();
}
}
@HiveType(typeId: 19)
class InteractionConfigData {
@HiveField(1)
InteractionResultData widgets;
@HiveField(2)
String id;
@HiveField(3)
String name;
@HiveField(4)
String? formtype;
InteractionConfigData({
required this.widgets,
required this.id,
required this.name,
this.formtype,
});
Map<String, dynamic> toJson() => {"widgets": widgets};
}