Skip to content

Commit 7041a84

Browse files
committed
refactor: fix requested changes
1 parent d07f80d commit 7041a84

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/gotrue/lib/src/types/user_attributes.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ class UserAttributes {
4040
}
4141

4242
@override
43-
bool operator ==(covariant UserAttributes other) {
43+
bool operator ==(Object other) {
4444
if (identical(this, other)) return true;
45+
if (other is! UserAttributes) return false;
46+
47+
final mapEquals = const DeepCollectionEquality().equals;
4548

4649
return other.email == email &&
4750
other.phone == phone &&
4851
other.password == password &&
4952
other.nonce == nonce &&
50-
other.data == data;
53+
mapEquals(other.data, data);
5154
}
5255

5356
@override
@@ -127,8 +130,10 @@ class AdminUserAttributes extends UserAttributes {
127130
}
128131

129132
@override
130-
bool operator ==(covariant AdminUserAttributes other) {
133+
bool operator ==(Object other) {
131134
if (identical(this, other)) return true;
135+
if (other is! AdminUserAttributes) return false;
136+
132137
final mapEquals = const DeepCollectionEquality().equals;
133138

134139
return mapEquals(other.userMetadata, userMetadata) &&
@@ -140,7 +145,8 @@ class AdminUserAttributes extends UserAttributes {
140145

141146
@override
142147
int get hashCode {
143-
return userMetadata.hashCode ^
148+
return super.hashCode ^
149+
userMetadata.hashCode ^
144150
appMetadata.hashCode ^
145151
emailConfirm.hashCode ^
146152
phoneConfirm.hashCode ^

0 commit comments

Comments
 (0)