import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/user_me_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/user_me_entity.g.dart'; @JsonSerializable() class UserMeEntity { String? id; String? name; String? avatar; String? phone; String? email; @JSONField(name: "follows_count") String? followsCount; @JSONField(name: "flowers_count") String? flowersCount; @JSONField(name: "posts_count") String? postsCount; List? households = []; List? estates = []; @JSONField(name: "default_unit") UserMeDefaultUnit? defaultUnit; UserMeInformation? information; UserMeEntity(); factory UserMeEntity.fromJson(Map json) => $UserMeEntityFromJson(json); Map toJson() => $UserMeEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class UserMeHouseholds { String? id; String? name; String? avatar; UserMeHouseholds(); factory UserMeHouseholds.fromJson(Map json) => $UserMeHouseholdsFromJson(json); Map toJson() => $UserMeHouseholdsToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class UserMeEstates { String? id; String? name; List? accounts = []; UserMeEstates(); factory UserMeEstates.fromJson(Map json) => $UserMeEstatesFromJson(json); Map toJson() => $UserMeEstatesToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class UserMeEstatesAccounts { String? id; String? name; String? avatar; String? type; @JSONField(name: "default") int isDefault = 0; String? status; UserMeEstatesAccountsUnit? unit; UserMeEstatesAccounts(); factory UserMeEstatesAccounts.fromJson(Map json) => $UserMeEstatesAccountsFromJson(json); Map toJson() => $UserMeEstatesAccountsToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class UserMeEstatesAccountsUnit { String? id; String? block; String? street; String? unit; String? address; UserMeEstatesAccountsUnit(); factory UserMeEstatesAccountsUnit.fromJson(Map json) => $UserMeEstatesAccountsUnitFromJson(json); Map toJson() => $UserMeEstatesAccountsUnitToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class UserMeDefaultUnit { String? id; @JSONField(name: "estate_id") String? estateId; String? block; String? street; String? unit; String? address; int type = 0; UserMeDefaultUnit(); factory UserMeDefaultUnit.fromJson(Map json) => $UserMeDefaultUnitFromJson(json); Map toJson() => $UserMeDefaultUnitToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class UserMeInformation { @JSONField(name: "first_name") String? firstName; @JSONField(name: "last_name") String? lastName; @JSONField(name: "country_code") String? countryCode; String? phone; UserMeInformation(); factory UserMeInformation.fromJson(Map json) => $UserMeInformationFromJson(json); Map toJson() => $UserMeInformationToJson(this); @override String toString() { return jsonEncode(this); } }