AccountProvider<TUser, TProfileUpdate> class abstract

The backend for a logged-in user's own account: current user, profile, avatar, password, deletion. Kept apart from AuthProvider, so an app writes only the parts it has.

TUser is the app's user model, TProfileUpdate its typed profile body. Every call fails with UnsupportedFailure until the subclass overrides it, and calls added to brix later arrive the same way.

Constructors

AccountProvider()
const

Properties

deletionMode → AccountDeletionMode
How account deletion is confirmed; AccountDeletionMode.none until the subclass says otherwise.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

changePassword({required String currentPassword, required String newPassword}) → Future<Result<void>>
currentPassword and newPassword are sent exactly as typed.
currentUser() → Future<Result<TUser>>
The logged-in user, fresh from the backend.
deleteAccount({required String identifier, String? code, String? password}) → Future<Result<void>>
Deletes the account. code or password as deletionMode needs.
mapError(Object error, StackTrace stackTrace) → Failure
Turns an error thrown by this backend into a Failure. Override like AuthProvider.mapError.
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).
toString() → String
A string representation of this object.
inherited
updateProfile(TProfileUpdate update) → Future<Result<void>>
uploadAvatar(AvatarUpload avatar) → Future<Result<void>>

Operators

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