BlitzWareAuthProvider class
BlitzWare authentication provider using ChangeNotifier
- Inheritance
-
- Object
- ChangeNotifier
- BlitzWareAuthProvider
- Available extensions
Constructors
- BlitzWareAuthProvider({required BlitzWareAuthService authService})
Properties
- error → BlitzWareException?
-
Current error, if any
no setter
- hasElevatedPrivileges → bool
-
Available on BlitzWareAuthProvider, provided by the BlitzWareAuthProviderRoles extension
Check if user has elevated privileges (admin or moderator)no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isAdmin → bool
-
Available on BlitzWareAuthProvider, provided by the BlitzWareAuthProviderRoles extension
Check if user is an adminno setter - isAuthenticated → bool
-
Whether user is authenticated
no setter
- isLoading → bool
-
Whether authentication is in progress
no setter
- isModerator → bool
-
Available on BlitzWareAuthProvider, provided by the BlitzWareAuthProviderRoles extension
Check if user is a moderatorno setter - isPremium → bool
-
Available on BlitzWareAuthProvider, provided by the BlitzWareAuthProviderRoles extension
Check if user has premium accessno setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- user → BlitzWareUser?
-
Current authenticated user
no setter
- userDisplayName → String?
-
Get user's display name
no setter
-
userRoles
→ List<
String> -
Get user's role names
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clearError(
) → void - Clear error manually
-
dispose(
) → void -
Discards any resources used by the object.
override
-
getAccessToken(
) → Future< String?> - Get access token with automatic validation/refresh
-
hasAllRoles(
List< String> roleNames) → bool - Check if user has all of the specified roles
-
hasAnyRole(
List< String> roleNames) → bool - Check if user has any of the specified roles
-
hasRole(
String role) → bool - Check if user has a specific role
-
login(
) → Future< void> - Authenticate user (login)
-
logout(
) → Future< void> - Log out user
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
refresh(
) → Future< void> - Refresh authentication state
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSession(
) → Future< bool> - Validate current session
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited