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