PortalAuthenticationRepository class
Repository for managing portal authentication operations.
This class extends ApiClient and provides methods for user login, logout, token management, profile retrieval, and more.
Constructors
Properties
- authenticationUri → Uri
-
no setter
- baseUrl → String
-
The base URL for the API.
no setteroverride
-
no setterinherited
- dio → Dio
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- persistentStorage → PersistentStorage
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureStorage → SecureStorage
-
no setterinherited
Methods
-
changeSavedTenant(
CurrentTenant tenant) → void - Changes the saved tenant in persistent storage.
-
countTenant(
) → Future< int> - Counts the number of tenants associated with the authenticated user.
-
createToken(
Tenant tenant) → Future< String?> - Creates a token for the specified tenant.
-
downloadBytes(
String url) → Future< Uint8List> -
Downloads content as bytes from a URL.
inherited
-
downloadFile(
{required String url, required String savePath, required String filename}) → Future< File?> -
Downloads content to a file.
inherited
-
forgotPassword(
String email) → Future< String> - Initiates the forgot password process.
-
forgotPasswordOtp(
String content, String password, String otpCode) → Future< List< Tenant> > - Completes the forgot password process using OTP.
-
getProfile(
) → Future< AppUser> - Retrieves the profile of the authenticated user.
-
getProfileInfo(
) → Future< AppUser> -
listTenant(
{TenantFilter? filter}) → Future< List< Tenant> > - Lists the tenants associated with the authenticated user.
-
loadAuthentication(
) → Future< TenantAuthentication?> - Loads the authentication details from persistent storage.
-
login(
String username, String password) → Future< List< Tenant> > - Logs in the user using username and password.
-
loginWithApple(
String idToken) → Future< List< Tenant> > - Logs in the user using Apple ID.
-
loginWithBiometric(
) → Future< List< Tenant> > - Logs in the user using biometric authentication.
-
loginWithGoogle(
String idToken) → Future< List< Tenant> > - Logs in the user using Google account.
-
loginWithMicrosoft(
String idToken) → Future< List< Tenant> > - Logs in the user using Microsoft account.
-
logout(
) → Future - Logs out the user.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshToken(
{String? refreshToken}) → Future< void> - Refreshes the authentication token.
-
saveAuthentication(
AppUser appUser, CurrentTenant tenant) → Future< void> - Saves the authentication information.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateProfileInfo(
AppUser appUser) → Future< AppUser> -
uploadFile(
{required String filePath, String uploadUrl = "/upload-file", String? filename}) → Future< File> -
Uploads a single file.
inherited
-
uploadFileFromFilePicker(
PlatformFile file, {String uploadUrl = "/upload-file"}) → Future< File> -
Uploads a file using
PlatformFile
.inherited -
uploadFileFromImagePicker(
XFile file, {String uploadUrl = "/upload-file"}) → Future< File> -
Uploads a file using
XFile
.inherited -
uploadFiles(
{required List< String> filePaths, String uploadUrl = "/multi-upload-file"}) → Future<List< File> > -
Uploads multiple files.
inherited
-
uploadFilesFromFilePicker(
List< PlatformFile> files, {String uploadUrl = "/multi-upload-file"}) → Future<List< File> > -
Uploads multiple files using
PlatformFile
.inherited -
uploadFilesFromImagePicker(
List< XFile> files, {String uploadUrl = "/multi-upload-file"}) → Future<List< File> > -
Uploads multiple files using
XFile
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited