APICredential class

Represents a authentication credential.

Constructors

APICredential(String username, {String? token, String? passwordHash, APIPasswordHashAlgorithm? hashAlgorithm})

Properties

hashCode int
The hash code for this object.
no setteroverride
hasPassword bool
Returns true if this APICredential has a password.
no setter
hasToken bool
Returns true if this APICredential has a token.
no setter
password APIPassword?
The APIPassword of this credential.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String?
The token of this credential.
final
username String
The username/email of this credential.
final
usernameEntity ↔ dynamic
The entity of the username.
getter/setter pair

Methods

checkCredential(APICredential? credential) bool
Checks if the passed credential matches this credential's username and password.
checkPassword(String? passwordOrHash) bool
Checks if the parameter passwordOrHash matches this APICredential password.
copy({bool withUsernameEntity = true, bool withPassword = true, bool withToken = true}) APICredential
Returns a copy of this APICredential.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withUsername(String username) APICredential
Returns a copy of this APICredential with username.

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromMap(Map<String, dynamic>? map, {bool requiresUsernameAndPassword = false}) APICredential?