|
@@ -19,13 +19,15 @@ UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
|
|
|
if (phone != null) {
|
|
|
userMeEntity.phone = phone;
|
|
|
}
|
|
|
- final String? followsCount = jsonConvert.convert<String>(
|
|
|
- json['follows_count']);
|
|
|
+ final String? email = jsonConvert.convert<String>(json['email']);
|
|
|
+ if (email != null) {
|
|
|
+ userMeEntity.email = email;
|
|
|
+ }
|
|
|
+ final String? followsCount = jsonConvert.convert<String>(json['follows_count']);
|
|
|
if (followsCount != null) {
|
|
|
userMeEntity.followsCount = followsCount;
|
|
|
}
|
|
|
- final String? flowersCount = jsonConvert.convert<String>(
|
|
|
- json['flowers_count']);
|
|
|
+ final String? flowersCount = jsonConvert.convert<String>(json['flowers_count']);
|
|
|
if (flowersCount != null) {
|
|
|
userMeEntity.flowersCount = flowersCount;
|
|
|
}
|
|
@@ -33,26 +35,24 @@ UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
|
|
|
if (postsCount != null) {
|
|
|
userMeEntity.postsCount = postsCount;
|
|
|
}
|
|
|
- final List<UserMeHouseholds>? households = (json['households'] as List<
|
|
|
- dynamic>?)
|
|
|
- ?.map(
|
|
|
- (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds)
|
|
|
- .toList();
|
|
|
+ final List<UserMeHouseholds>? households = (json['households'] as List<dynamic>?)?.map(
|
|
|
+ (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds).toList();
|
|
|
if (households != null) {
|
|
|
userMeEntity.households = households;
|
|
|
}
|
|
|
- final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)
|
|
|
- ?.map(
|
|
|
- (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates)
|
|
|
- .toList();
|
|
|
+ final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)?.map(
|
|
|
+ (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates).toList();
|
|
|
if (estates != null) {
|
|
|
userMeEntity.estates = estates;
|
|
|
}
|
|
|
- final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(
|
|
|
- json['default_unit']);
|
|
|
+ final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(json['default_unit']);
|
|
|
if (defaultUnit != null) {
|
|
|
userMeEntity.defaultUnit = defaultUnit;
|
|
|
}
|
|
|
+ final UserMeInformation? information = jsonConvert.convert<UserMeInformation>(json['information']);
|
|
|
+ if (information != null) {
|
|
|
+ userMeEntity.information = information;
|
|
|
+ }
|
|
|
return userMeEntity;
|
|
|
}
|
|
|
|
|
@@ -62,12 +62,14 @@ Map<String, dynamic> $UserMeEntityToJson(UserMeEntity entity) {
|
|
|
data['name'] = entity.name;
|
|
|
data['avatar'] = entity.avatar;
|
|
|
data['phone'] = entity.phone;
|
|
|
+ data['email'] = entity.email;
|
|
|
data['follows_count'] = entity.followsCount;
|
|
|
data['flowers_count'] = entity.flowersCount;
|
|
|
data['posts_count'] = entity.postsCount;
|
|
|
data['households'] = entity.households?.map((v) => v.toJson()).toList();
|
|
|
data['estates'] = entity.estates?.map((v) => v.toJson()).toList();
|
|
|
data['default_unit'] = entity.defaultUnit?.toJson();
|
|
|
+ data['information'] = entity.information?.toJson();
|
|
|
return data;
|
|
|
}
|
|
|
|
|
@@ -77,24 +79,28 @@ extension UserMeEntityExtension on UserMeEntity {
|
|
|
String? name,
|
|
|
String? avatar,
|
|
|
String? phone,
|
|
|
+ String? email,
|
|
|
String? followsCount,
|
|
|
String? flowersCount,
|
|
|
String? postsCount,
|
|
|
List<UserMeHouseholds>? households,
|
|
|
List<UserMeEstates>? estates,
|
|
|
UserMeDefaultUnit? defaultUnit,
|
|
|
+ UserMeInformation? information,
|
|
|
}) {
|
|
|
return UserMeEntity()
|
|
|
..id = id ?? this.id
|
|
|
..name = name ?? this.name
|
|
|
..avatar = avatar ?? this.avatar
|
|
|
..phone = phone ?? this.phone
|
|
|
+ ..email = email ?? this.email
|
|
|
..followsCount = followsCount ?? this.followsCount
|
|
|
..flowersCount = flowersCount ?? this.flowersCount
|
|
|
..postsCount = postsCount ?? this.postsCount
|
|
|
..households = households ?? this.households
|
|
|
..estates = estates ?? this.estates
|
|
|
- ..defaultUnit = defaultUnit ?? this.defaultUnit;
|
|
|
+ ..defaultUnit = defaultUnit ?? this.defaultUnit
|
|
|
+ ..information = information ?? this.information;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -146,12 +152,8 @@ UserMeEstates $UserMeEstatesFromJson(Map<String, dynamic> json) {
|
|
|
if (name != null) {
|
|
|
userMeEstates.name = name;
|
|
|
}
|
|
|
- final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<
|
|
|
- dynamic>?)
|
|
|
- ?.map(
|
|
|
- (e) =>
|
|
|
- jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts)
|
|
|
- .toList();
|
|
|
+ final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<dynamic>?)?.map(
|
|
|
+ (e) => jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts).toList();
|
|
|
if (accounts != null) {
|
|
|
userMeEstates.accounts = accounts;
|
|
|
}
|
|
@@ -179,8 +181,7 @@ extension UserMeEstatesExtension on UserMeEstates {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(
|
|
|
- Map<String, dynamic> json) {
|
|
|
+UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(Map<String, dynamic> json) {
|
|
|
final UserMeEstatesAccounts userMeEstatesAccounts = UserMeEstatesAccounts();
|
|
|
final String? id = jsonConvert.convert<String>(json['id']);
|
|
|
if (id != null) {
|
|
@@ -202,20 +203,18 @@ UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(
|
|
|
if (isDefault != null) {
|
|
|
userMeEstatesAccounts.isDefault = isDefault;
|
|
|
}
|
|
|
- final dynamic status = json['status'];
|
|
|
+ final String? status = jsonConvert.convert<String>(json['status']);
|
|
|
if (status != null) {
|
|
|
userMeEstatesAccounts.status = status;
|
|
|
}
|
|
|
- final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<
|
|
|
- UserMeEstatesAccountsUnit>(json['unit']);
|
|
|
+ final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<UserMeEstatesAccountsUnit>(json['unit']);
|
|
|
if (unit != null) {
|
|
|
userMeEstatesAccounts.unit = unit;
|
|
|
}
|
|
|
return userMeEstatesAccounts;
|
|
|
}
|
|
|
|
|
|
-Map<String, dynamic> $UserMeEstatesAccountsToJson(
|
|
|
- UserMeEstatesAccounts entity) {
|
|
|
+Map<String, dynamic> $UserMeEstatesAccountsToJson(UserMeEstatesAccounts entity) {
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
data['id'] = entity.id;
|
|
|
data['name'] = entity.name;
|
|
@@ -234,7 +233,7 @@ extension UserMeEstatesAccountsExtension on UserMeEstatesAccounts {
|
|
|
String? avatar,
|
|
|
String? type,
|
|
|
int? isDefault,
|
|
|
- dynamic status,
|
|
|
+ String? status,
|
|
|
UserMeEstatesAccountsUnit? unit,
|
|
|
}) {
|
|
|
return UserMeEstatesAccounts()
|
|
@@ -248,8 +247,7 @@ extension UserMeEstatesAccountsExtension on UserMeEstatesAccounts {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(
|
|
|
- Map<String, dynamic> json) {
|
|
|
+UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(Map<String, dynamic> json) {
|
|
|
final UserMeEstatesAccountsUnit userMeEstatesAccountsUnit = UserMeEstatesAccountsUnit();
|
|
|
final String? id = jsonConvert.convert<String>(json['id']);
|
|
|
if (id != null) {
|
|
@@ -274,8 +272,7 @@ UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(
|
|
|
return userMeEstatesAccountsUnit;
|
|
|
}
|
|
|
|
|
|
-Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(
|
|
|
- UserMeEstatesAccountsUnit entity) {
|
|
|
+Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(UserMeEstatesAccountsUnit entity) {
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
data['id'] = entity.id;
|
|
|
data['block'] = entity.block;
|
|
@@ -366,4 +363,49 @@ extension UserMeDefaultUnitExtension on UserMeDefaultUnit {
|
|
|
..address = address ?? this.address
|
|
|
..type = type ?? this.type;
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+UserMeInformation $UserMeInformationFromJson(Map<String, dynamic> json) {
|
|
|
+ final UserMeInformation userMeInformation = UserMeInformation();
|
|
|
+ final String? firstName = jsonConvert.convert<String>(json['first_name']);
|
|
|
+ if (firstName != null) {
|
|
|
+ userMeInformation.firstName = firstName;
|
|
|
+ }
|
|
|
+ final String? lastName = jsonConvert.convert<String>(json['last_name']);
|
|
|
+ if (lastName != null) {
|
|
|
+ userMeInformation.lastName = lastName;
|
|
|
+ }
|
|
|
+ final String? countryCode = jsonConvert.convert<String>(json['country_code']);
|
|
|
+ if (countryCode != null) {
|
|
|
+ userMeInformation.countryCode = countryCode;
|
|
|
+ }
|
|
|
+ final String? phone = jsonConvert.convert<String>(json['phone']);
|
|
|
+ if (phone != null) {
|
|
|
+ userMeInformation.phone = phone;
|
|
|
+ }
|
|
|
+ return userMeInformation;
|
|
|
+}
|
|
|
+
|
|
|
+Map<String, dynamic> $UserMeInformationToJson(UserMeInformation entity) {
|
|
|
+ final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
+ data['first_name'] = entity.firstName;
|
|
|
+ data['last_name'] = entity.lastName;
|
|
|
+ data['country_code'] = entity.countryCode;
|
|
|
+ data['phone'] = entity.phone;
|
|
|
+ return data;
|
|
|
+}
|
|
|
+
|
|
|
+extension UserMeInformationExtension on UserMeInformation {
|
|
|
+ UserMeInformation copyWith({
|
|
|
+ String? firstName,
|
|
|
+ String? lastName,
|
|
|
+ String? countryCode,
|
|
|
+ String? phone,
|
|
|
+ }) {
|
|
|
+ return UserMeInformation()
|
|
|
+ ..firstName = firstName ?? this.firstName
|
|
|
+ ..lastName = lastName ?? this.lastName
|
|
|
+ ..countryCode = countryCode ?? this.countryCode
|
|
|
+ ..phone = phone ?? this.phone;
|
|
|
+ }
|
|
|
}
|