1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import 'package:domain/generated/json/base/json_convert_content.dart';
- import 'package:domain/entity/rewards_home_tx_entity.dart';
- RewardsHomeTxEntity $RewardsHomeTxEntityFromJson(Map<String, dynamic> json) {
- final RewardsHomeTxEntity rewardsHomeTxEntity = RewardsHomeTxEntity();
- final double? id = jsonConvert.convert<double>(json['id']);
- if (id != null) {
- rewardsHomeTxEntity.id = id;
- }
- final String? name = jsonConvert.convert<String>(json['name']);
- if (name != null) {
- rewardsHomeTxEntity.name = name;
- }
- final List<dynamic>? rewards = (json['rewards'] as List<dynamic>?)?.map(
- (e) => e).toList();
- if (rewards != null) {
- rewardsHomeTxEntity.rewards = rewards;
- }
- return rewardsHomeTxEntity;
- }
- Map<String, dynamic> $RewardsHomeTxEntityToJson(RewardsHomeTxEntity entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['id'] = entity.id;
- data['name'] = entity.name;
- data['rewards'] = entity.rewards;
- return data;
- }
- extension RewardsHomeTxEntityExtension on RewardsHomeTxEntity {
- RewardsHomeTxEntity copyWith({
- double? id,
- String? name,
- List<dynamic>? rewards,
- }) {
- return RewardsHomeTxEntity()
- ..id = id ?? this.id
- ..name = name ?? this.name
- ..rewards = rewards ?? this.rewards;
- }
- }
|