FakeAuthProvider<TSignup, TUser> class

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

Inheritance

Constructors

FakeAuthProvider({AuthCapabilities capabilities = const AuthCapabilities()})

Properties

capabilities → AuthCapabilities
final
error ↔ Object?
Thrown by every call instead of answering, when set.
getter/setter pair
forgotPasswordCalls → List<String>
Every call as received: the identifier.
final
forgotPasswordResult ↔ Result<void>
What forgotPassword and resetPassword answer.
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
loginCalls → List<String>
Every call as received: identifier|password.
final
loginResult ↔ Result<AuthSession<TUser>>?
What login answers.
getter/setter pair
logoutCalls ↔ int
getter/setter pair
registerCalls → List<TSignup>
Every register request as received.
final
registerResult ↔ Result<void>
What register answers.
getter/setter pair
resendOtpCalls → List<String>
Every call as received: identifier|purpose.
final
resendOtpResult ↔ Result<void>
getter/setter pair
resetPasswordCalls → List<String>
Every call as received: identifier|code|newPassword.
final
resetPasswordResult ↔ Result<void>
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
verifyOtpCalls → List<String>
Every call as received: identifier|code|purpose.
final
verifyOtpResult ↔ Result<void>
What verifyOtp and resendOtp answer.
getter/setter pair

Methods

forgotPassword({required String identifier}) → Future<Result<void>>
Sends the reset code or link, depending on AuthCapabilities.resetMode.
override
login({required String identifier, required String password}) → Future<Result<AuthSession<TUser>>>
override
logout() → Future<Result<void>>
Ends the session on the server. Local data is cleared by the flows even when this fails.
override
mapError(Object error, StackTrace stackTrace) → Failure
Turns an error thrown by this backend into a Failure. Override to map the backend's own errors (socket errors, SDK error codes) and call super.mapError for the rest.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(TSignup request) → Future<Result<void>>
override
resendOtp({required String identifier, required OtpPurpose purpose}) → Future<Result<void>>
override
resetPassword({required String identifier, required String newPassword, String? code}) → Future<Result<void>>
code is required when AuthCapabilities.resetMode is ResetMode.otp.
override
toString() → String
A string representation of this object.
inherited
verifyOtp({required String identifier, required String code, required OtpPurpose purpose}) → Future<Result<void>>
override

Operators

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