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 formFields; UIDataResponse({ required this.success, required this.message, required this.formFields, }); factory UIDataResponse.fromJson(Map json) => UIDataResponse( success: json["success"], message: json["message"], formFields: List.from( json["form-fields"].map((x) => FormFieldData.fromJson(x))), ); Map toJson() => { "success": success, "message": message, "form-fields": List.from(formFields.map((x) => x.toJson())), }; } @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 toJson() => {"widgets": widgets}; }