id_name_entity.g.dart 913 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/id_name_entity.dart';
  3. IdNameEntity $IdNameEntityFromJson(Map<String, dynamic> json) {
  4. final IdNameEntity idNameEntity = IdNameEntity();
  5. final String? id = jsonConvert.convert<String>(json['id']);
  6. if (id != null) {
  7. idNameEntity.id = id;
  8. }
  9. final String? name = jsonConvert.convert<String>(json['name']);
  10. if (name != null) {
  11. idNameEntity.name = name;
  12. }
  13. return idNameEntity;
  14. }
  15. Map<String, dynamic> $IdNameEntityToJson(IdNameEntity entity) {
  16. final Map<String, dynamic> data = <String, dynamic>{};
  17. data['id'] = entity.id;
  18. data['name'] = entity.name;
  19. return data;
  20. }
  21. extension IdNameEntityExtension on IdNameEntity {
  22. IdNameEntity copyWith({
  23. String? id,
  24. String? name,
  25. }) {
  26. return IdNameEntity()
  27. ..id = id ?? this.id
  28. ..name = name ?? this.name;
  29. }
  30. }