[mob] Add attributes for person email & userID

This commit is contained in:
Neeraj Gupta
2024-11-04 13:44:07 +05:30
parent ca7ed779d6
commit 63471eea85

View File

@@ -53,6 +53,10 @@ class PersonData {
List<ClusterInfo>? assigned = List<ClusterInfo>.empty();
List<ClusterInfo>? rejected = List<ClusterInfo>.empty();
final String? birthDate;
// email should be always looked via userID as user might have changed
// their email ids.
final String? email;
final int? userID;
bool hasAvatar() => avatarFaceID != null;
@@ -66,6 +70,8 @@ class PersonData {
this.avatarFaceID,
this.isHidden = false,
this.birthDate,
this.email,
this.userID,
});
// copyWith
PersonData copyWith({
@@ -75,6 +81,8 @@ class PersonData {
bool? isHidden,
int? version,
String? birthDate,
String? email,
int? userID,
}) {
return PersonData(
name: name ?? this.name,
@@ -82,6 +90,8 @@ class PersonData {
avatarFaceID: avatarFaceId ?? this.avatarFaceID,
isHidden: isHidden ?? this.isHidden,
birthDate: birthDate ?? this.birthDate,
email: email ?? this.email,
userID: userID ?? this.userID,
);
}
@@ -112,6 +122,8 @@ class PersonData {
'avatarFaceID': avatarFaceID,
'isHidden': isHidden,
'birthDate': birthDate,
'email': email,
'userID': userID,
};
// fromJson
@@ -134,6 +146,8 @@ class PersonData {
avatarFaceID: json['avatarFaceID'] as String?,
isHidden: json['isHidden'] as bool? ?? false,
birthDate: json['birthDate'] as String?,
userID: json['userID'] as int?,
email: json['email'] as String?,
);
}
}