form_option_entity.g.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/form_option_entity.dart';
  3. FormOptionEntity $FormOptionEntityFromJson(Map<String, dynamic> json) {
  4. final FormOptionEntity formOptionEntity = FormOptionEntity();
  5. final List<String>? typeOfApplication = (json['type_of_application'] as List<
  6. dynamic>?)?.map(
  7. (e) => jsonConvert.convert<String>(e) as String).toList();
  8. if (typeOfApplication != null) {
  9. formOptionEntity.typeOfApplication = typeOfApplication;
  10. }
  11. final List<String>? ownershipStatus = (json['ownership_status'] as List<
  12. dynamic>?)?.map(
  13. (e) => jsonConvert.convert<String>(e) as String).toList();
  14. if (ownershipStatus != null) {
  15. formOptionEntity.ownershipStatus = ownershipStatus;
  16. }
  17. return formOptionEntity;
  18. }
  19. Map<String, dynamic> $FormOptionEntityToJson(FormOptionEntity entity) {
  20. final Map<String, dynamic> data = <String, dynamic>{};
  21. data['type_of_application'] = entity.typeOfApplication;
  22. data['ownership_status'] = entity.ownershipStatus;
  23. return data;
  24. }
  25. extension FormOptionEntityExtension on FormOptionEntity {
  26. FormOptionEntity copyWith({
  27. List<String>? typeOfApplication,
  28. List<String>? ownershipStatus,
  29. }) {
  30. return FormOptionEntity()
  31. ..typeOfApplication = typeOfApplication ?? this.typeOfApplication
  32. ..ownershipStatus = ownershipStatus ?? this.ownershipStatus;
  33. }
  34. }