mobileApplicationsKonectarApp/lib/model/interaction_config_data.dart

49 lines
1.1 KiB
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())),
};
}
@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};
}