after rediense
This commit is contained in:
@@ -9,6 +9,8 @@ class MyUser extends Equatable {
|
||||
final String? name;
|
||||
final String? nickname;
|
||||
final String? picture;
|
||||
final String? birthday;
|
||||
final String? gender;
|
||||
|
||||
const MyUser({
|
||||
required this.id,
|
||||
@@ -17,8 +19,16 @@ class MyUser extends Equatable {
|
||||
this.name,
|
||||
this.nickname,
|
||||
this.picture,
|
||||
this.birthday,
|
||||
this.gender,
|
||||
});
|
||||
|
||||
get drawerLabel => email != null && email!.isNotEmpty
|
||||
? email!
|
||||
: phone != null && phone!.isNotEmpty
|
||||
? phone!
|
||||
: "N/A";
|
||||
|
||||
/// Empty user which represents an unauthenticated user.
|
||||
static const empty = MyUser(
|
||||
id: '',
|
||||
@@ -27,6 +37,8 @@ class MyUser extends Equatable {
|
||||
name: '',
|
||||
nickname: '',
|
||||
picture: '',
|
||||
birthday: '',
|
||||
gender: '',
|
||||
);
|
||||
|
||||
/// Modify MyUser parameters
|
||||
@@ -37,6 +49,8 @@ class MyUser extends Equatable {
|
||||
String? name,
|
||||
String? nickname,
|
||||
String? picture,
|
||||
String? birthday,
|
||||
String? gender,
|
||||
}) {
|
||||
return MyUser(
|
||||
id: id ?? this.id,
|
||||
@@ -45,6 +59,8 @@ class MyUser extends Equatable {
|
||||
name: name ?? this.name,
|
||||
nickname: nickname ?? this.nickname,
|
||||
picture: picture ?? this.picture,
|
||||
birthday: birthday ?? this.birthday,
|
||||
gender: gender ?? this.gender,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -62,6 +78,8 @@ class MyUser extends Equatable {
|
||||
name: name,
|
||||
nickname: nickname,
|
||||
picture: picture,
|
||||
birthday: birthday,
|
||||
gender: gender,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,9 +91,12 @@ class MyUser extends Equatable {
|
||||
name: entity.name,
|
||||
nickname: entity.nickname,
|
||||
picture: entity.picture,
|
||||
birthday: entity.birthday,
|
||||
gender: entity.gender,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, email, phone, name, nickname, picture];
|
||||
List<Object?> get props =>
|
||||
[id, email, phone, name, nickname, picture, birthday, gender];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user