AuthHttpSource class
HTTP-based implementation of authentication source.
This class provides authentication operations using HTTP requests, including user registration, login, logout, and password change functionality. It follows the same pattern as DataSourceDataActionsHttpSources for consistency.
- Implemented types
Constructors
- AuthHttpSource({String? baseUrl = "", required String email, required String pass, String? loginUrl, String? createAccountUrl, String? logoutUrl, String? changePasswordUrl})
- Constructor for creating an AuthHttpSource instance.
- AuthHttpSource.inputs({String? baseUrl = "", required String email, required String pass, String? loginUrl, String? createAccountUrl, String? logoutUrl, String? changePasswordUrl})
-
Factory constructor for creating an AuthHttpSource instance with configurable endpoints.
factory
Properties
- baseUrl ↔ String
-
The base URL for API requests (defaults to ApiUrls.BASE_URL)
getter/setter pair
- changePasswordUrl ↔ String
-
The endpoint URL for password change operations (default: "change-password")
getter/setter pair
- createAccountUrl ↔ String
-
The endpoint URL for account creation (default: "register")
getter/setter pair
- email ↔ String?
-
The user's email address
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- loginUrl ↔ String
-
The endpoint URL for login operations (default: "login")
getter/setter pair
- logoutUrl ↔ String
-
The endpoint URL for logout operations (default: "logout")
getter/setter pair
- name ↔ String?
-
The user's name (optional)
getter/setter pair
- pass ↔ String?
-
The user's password
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
changePassword(
String email, String oldPassword, String newPassword) → Future< UsersBaseModel> -
Changes the user's password via HTTP POST request.
override
-
createAccount(
{Map< String, dynamic> ? body}) → Future<UsersBaseModel> -
Creates a new user account via HTTP POST request.
override
-
logIn(
) → Future< UsersBaseModel> -
Authenticates a user via HTTP POST request.
override
-
logOut(
) → Future< void> -
Logs out the current user via HTTP POST request.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited