FakeAccountProvider<TUser, TProfileUpdate> class

Account backend whose answers are set by the test, and which records every call.

Inheritance

Constructors

FakeAccountProvider({AccountDeletionMode deletionMode = AccountDeletionMode.code})

Properties

changePasswordCalls → List<String>
currentPassword|newPassword.
final
changePasswordResult ↔ Result<void>
getter/setter pair
currentUserCalls ↔ int
getter/setter pair
currentUserResult ↔ Result<TUser>?
What currentUser answers; null = unsupported.
getter/setter pair
deleteAccountCalls → List<String>
identifier|code|password.
final
deleteAccountResult ↔ Result<void>
getter/setter pair
deletionMode → AccountDeletionMode
How account deletion is confirmed; AccountDeletionMode.none until the subclass says otherwise.
final
error ↔ Object?
Thrown by every call instead of answering, when set.
getter/setter pair
gate ↔ Completer<void>?
Complete this to finish a call the test holds open; null = answer now.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
requestDeletionCalls → List<String>
The identifier of every request.
final
requestDeletionResult ↔ Result<void>
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
updateProfileCalls → List<TProfileUpdate>
final
updateProfileResult ↔ Result<void>
getter/setter pair
uploadAvatarCalls → List<AvatarUpload>
final
uploadAvatarResult ↔ Result<void>
getter/setter pair

Methods

changePassword({required String currentPassword, required String newPassword}) → Future<Result<void>>
currentPassword and newPassword are sent exactly as typed.
override
currentUser() → Future<Result<TUser>>
The logged-in user, fresh from the backend.
override
deleteAccount({required String identifier, String? code, String? password}) → Future<Result<void>>
Deletes the account. code or password as deletionMode needs.
override
mapError(Object error, StackTrace stackTrace) → Failure
Turns an error thrown by this backend into a Failure. Override like AuthProvider.mapError.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestAccountDeletion({required String identifier}) → Future<Result<void>>
AccountDeletionMode.code: sends the code to identifier (also used to send a new one).
override
toString() → String
A string representation of this object.
inherited
updateProfile(TProfileUpdate update) → Future<Result<void>>
override
uploadAvatar(AvatarUpload avatar) → Future<Result<void>>
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited