form_option_entity.g.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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<dynamic>?)?.map(
  6. (e) => jsonConvert.convert<String>(e) as String).toList();
  7. if (typeOfApplication != null) {
  8. formOptionEntity.typeOfApplication = typeOfApplication;
  9. }
  10. final List<String>? ownershipStatus = (json['ownership_status'] as List<dynamic>?)?.map(
  11. (e) => jsonConvert.convert<String>(e) as String).toList();
  12. if (ownershipStatus != null) {
  13. formOptionEntity.ownershipStatus = ownershipStatus;
  14. }
  15. return formOptionEntity;
  16. }
  17. Map<String, dynamic> $FormOptionEntityToJson(FormOptionEntity entity) {
  18. final Map<String, dynamic> data = <String, dynamic>{};
  19. data['type_of_application'] = entity.typeOfApplication;
  20. data['ownership_status'] = entity.ownershipStatus;
  21. return data;
  22. }
  23. extension FormOptionEntityExtension on FormOptionEntity {
  24. FormOptionEntity copyWith({
  25. List<String>? typeOfApplication,
  26. List<String>? ownershipStatus,
  27. }) {
  28. return FormOptionEntity()
  29. ..typeOfApplication = typeOfApplication ?? this.typeOfApplication
  30. ..ownershipStatus = ownershipStatus ?? this.ownershipStatus;
  31. }
  32. }