import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/rewards_index_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/rewards_index_entity.g.dart'; @JsonSerializable() class RewardsIndexEntity { late int points = 0; late RewardsIndexContinuous continuous; late RewardsIndexTasks tasks; late List latest = []; RewardsIndexEntity(); factory RewardsIndexEntity.fromJson(Map json) => $RewardsIndexEntityFromJson(json); Map toJson() => $RewardsIndexEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsIndexContinuous { late int count = 0; @JSONField(name: "current_week_checkin") late List currentWeekCheckin = []; RewardsIndexContinuous(); factory RewardsIndexContinuous.fromJson(Map json) => $RewardsIndexContinuousFromJson(json); Map toJson() => $RewardsIndexContinuousToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsIndexTasks { @JSONField(name: "daily_checkin") late bool dailyCheckin = false; @JSONField(name: "news_feed_post") late bool newsFeedPost = false; @JSONField(name: "give_10_likes") late int give10Likes = 0; RewardsIndexTasks(); factory RewardsIndexTasks.fromJson(Map json) => $RewardsIndexTasksFromJson(json); Map toJson() => $RewardsIndexTasksToJson(this); @override String toString() { return jsonEncode(this); } }