feat(auth): add toString and equality on entities and models
This commit is contained in:
parent
33ac5c6280
commit
08f789725b
@ -60,4 +60,28 @@ class AccountModel extends Account {
|
|||||||
this.phoneNumber,
|
this.phoneNumber,
|
||||||
this.photoURL,
|
this.photoURL,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AccountModel copyWith({
|
||||||
|
String? uid,
|
||||||
|
String? email,
|
||||||
|
DateTime? creationTime,
|
||||||
|
bool? emailVerified,
|
||||||
|
bool? isAnonymous,
|
||||||
|
bool? isNewUser,
|
||||||
|
DateTime? lastSignInTime,
|
||||||
|
String? phoneNumber,
|
||||||
|
String? photoURL,
|
||||||
|
String? providerId,
|
||||||
|
}) => AccountModel(
|
||||||
|
uid: uid ?? this.uid,
|
||||||
|
email: email ?? this.email,
|
||||||
|
creationTime: creationTime ?? this.creationTime,
|
||||||
|
emailVerified: emailVerified ?? this.emailVerified,
|
||||||
|
isAnonymous: isAnonymous ?? this.isAnonymous,
|
||||||
|
isNewUser: isNewUser ?? this.isNewUser,
|
||||||
|
lastSignInTime: lastSignInTime ?? this.lastSignInTime,
|
||||||
|
phoneNumber: phoneNumber ?? this.phoneNumber,
|
||||||
|
photoURL: photoURL ?? this.photoURL,
|
||||||
|
providerId: providerId ?? this.providerId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Please see the AUTHORS file for details.
|
// Please see the AUTHORS file for details.
|
||||||
//
|
//
|
||||||
@ -24,4 +25,12 @@ class AccountWrapperModel<T> extends AccountWrapper<T> {
|
|||||||
final T? data;
|
final T? data;
|
||||||
|
|
||||||
AccountWrapperModel(this.account, this.data);
|
AccountWrapperModel(this.account, this.data);
|
||||||
|
|
||||||
|
AccountWrapperModel<T> copyWith({
|
||||||
|
Account? account,
|
||||||
|
T? data,
|
||||||
|
}) => AccountWrapperModel<T>(
|
||||||
|
account ?? this.account,
|
||||||
|
data ?? this.data,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -73,4 +73,11 @@ abstract class Account extends Equatable implements Entity {
|
|||||||
providerId,
|
providerId,
|
||||||
isNewUser,
|
isNewUser,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AccountModel(uid: $uid, email: $email, '
|
||||||
|
'creationTime: $creationTime, emailVerified: $emailVerified, '
|
||||||
|
'isAnonymous: $isAnonymous, isNewUser: $isNewUser, lastSignInTime: '
|
||||||
|
'$lastSignInTime, phoneNumber: $phoneNumber, photoURL: $photoURL, '
|
||||||
|
'providerId: $providerId)';
|
||||||
}
|
}
|
||||||
|
@ -24,4 +24,7 @@ abstract class AccountWrapper<T> extends Equatable implements Entity {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [account, data];
|
List<Object?> get props => [account, data];
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AccountWrapper($account, data: $data)';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user