Authenticatable class abstract
Interface for authenticatable entities (users)
This interface defines the contract that user models must implement to be used with the authentication system. It provides a consistent way to access user data across different authentication drivers.
Example implementation:
class User implements Authenticatable {
final int id;
final String email;
final String password;
final bool isActive;
User({
required this.id,
required this.email,
required this.password,
this.isActive = true,
});
@override
dynamic getAuthIdentifier() => id;
@override
String getAuthIdentifierName() => 'id';
@override
String? getAuthPassword() => password;
@override
Map<String, dynamic> toAuthArray() => {
'id': id,
'email': email,
'is_active': isActive,
};
}
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getAuthIdentifier(
) → dynamic - Gets the unique identifier for the user
-
getAuthIdentifierName(
) → String - Gets the name of the unique identifier column
-
getAuthPassword(
) → String? - Gets the password for the user
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toAuthArray(
) → Map< String, dynamic> - Converts the user to an array for authentication
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited