import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/rewards_home_tes_entity.dart'; RewardsHomeTesEntity $RewardsHomeTesEntityFromJson(Map json) { final RewardsHomeTesEntity rewardsHomeTesEntity = RewardsHomeTesEntity(); final double? id = jsonConvert.convert(json['id']); if (id != null) { rewardsHomeTesEntity.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { rewardsHomeTesEntity.name = name; } final List? rewards = (json['rewards'] as List?)?.map( (e) => jsonConvert.convert(e) as RewardsHomeTesRewards).toList(); if (rewards != null) { rewardsHomeTesEntity.rewards = rewards; } return rewardsHomeTesEntity; } Map $RewardsHomeTesEntityToJson(RewardsHomeTesEntity entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['rewards'] = entity.rewards.map((v) => v.toJson()).toList(); return data; } extension RewardsHomeTesEntityExtension on RewardsHomeTesEntity { RewardsHomeTesEntity copyWith({ double? id, String? name, List? rewards, }) { return RewardsHomeTesEntity() ..id = id ?? this.id ..name = name ?? this.name ..rewards = rewards ?? this.rewards; } } RewardsHomeTesRewards $RewardsHomeTesRewardsFromJson(Map json) { final RewardsHomeTesRewards rewardsHomeTesRewards = RewardsHomeTesRewards(); final double? id = jsonConvert.convert(json['id']); if (id != null) { rewardsHomeTesRewards.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { rewardsHomeTesRewards.name = name; } final List? resources = (json['resources'] as List?)?.map( (e) => jsonConvert.convert(e) as String).toList(); if (resources != null) { rewardsHomeTesRewards.resources = resources; } final double? originalPoint = jsonConvert.convert(json['original_point']); if (originalPoint != null) { rewardsHomeTesRewards.originalPoint = originalPoint; } final double? point = jsonConvert.convert(json['point']); if (point != null) { rewardsHomeTesRewards.point = point; } return rewardsHomeTesRewards; } Map $RewardsHomeTesRewardsToJson(RewardsHomeTesRewards entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['resources'] = entity.resources; data['original_point'] = entity.originalPoint; data['point'] = entity.point; return data; } extension RewardsHomeTesRewardsExtension on RewardsHomeTesRewards { RewardsHomeTesRewards copyWith({ double? id, String? name, List? resources, double? originalPoint, double? point, }) { return RewardsHomeTesRewards() ..id = id ?? this.id ..name = name ?? this.name ..resources = resources ?? this.resources ..originalPoint = originalPoint ?? this.originalPoint ..point = point ?? this.point; } }