rewards_home_test_entity.g.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/rewards_home_test_entity.dart';
  3. RewardsHomeTestEntity $RewardsHomeTestEntityFromJson(Map<String, dynamic> json) {
  4. final RewardsHomeTestEntity rewardsHomeTestEntity = RewardsHomeTestEntity();
  5. final int? id = jsonConvert.convert<int>(json['id']);
  6. if (id != null) {
  7. rewardsHomeTestEntity.id = id;
  8. }
  9. final String? name = jsonConvert.convert<String>(json['name']);
  10. if (name != null) {
  11. rewardsHomeTestEntity.name = name;
  12. }
  13. final List<dynamic>? rewards = (json['rewards'] as List<dynamic>?)?.map(
  14. (e) => e).toList();
  15. if (rewards != null) {
  16. rewardsHomeTestEntity.rewards = rewards;
  17. }
  18. return rewardsHomeTestEntity;
  19. }
  20. Map<String, dynamic> $RewardsHomeTestEntityToJson(RewardsHomeTestEntity entity) {
  21. final Map<String, dynamic> data = <String, dynamic>{};
  22. data['id'] = entity.id;
  23. data['name'] = entity.name;
  24. data['rewards'] = entity.rewards;
  25. return data;
  26. }
  27. extension RewardsHomeTestEntityExtension on RewardsHomeTestEntity {
  28. RewardsHomeTestEntity copyWith({
  29. int? id,
  30. String? name,
  31. List<dynamic>? rewards,
  32. }) {
  33. return RewardsHomeTestEntity()
  34. ..id = id ?? this.id
  35. ..name = name ?? this.name
  36. ..rewards = rewards ?? this.rewards;
  37. }
  38. }