import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/rewards_home_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/rewards_home_entity.g.dart'; @JsonSerializable() class RewardsHomeEntity { late List data = []; late String message = ''; late int code = 0; RewardsHomeEntity(); factory RewardsHomeEntity.fromJson(Map json) => $RewardsHomeEntityFromJson(json); Map toJson() => $RewardsHomeEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsHomeData { late int id = 0; late String name = ''; late List rewards = []; RewardsHomeData(); factory RewardsHomeData.fromJson(Map json) => $RewardsHomeDataFromJson(json); Map toJson() => $RewardsHomeDataToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsHomeDataRewards { late int id = 0; late String name = ''; late List resources = []; @JSONField(name: "original_point") late int originalPoint = 0; late int point = 0; RewardsHomeDataRewards(); factory RewardsHomeDataRewards.fromJson(Map json) => $RewardsHomeDataRewardsFromJson(json); Map toJson() => $RewardsHomeDataRewardsToJson(this); @override String toString() { return jsonEncode(this); } }