ArcaneAuthProvider class

Authentication provider component

Wraps your app to provide authentication state throughout the component tree.

ArcaneAuthProvider(
  serverApiUrl: 'https://api.example.com',
  redirectOnLogin: '/dashboard',
  redirectOnLogout: '/login',
  child: const AppRouter(),
)
Inheritance

Constructors

ArcaneAuthProvider({required Component child, void onAuthStateChanged(dynamic)?, String? redirectOnLogin, String? redirectOnLogout, String? serverApiUrl, Key? key})
const

Properties

child Component
The child component to wrap
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one component replaces another component in the tree.
finalinherited
onAuthStateChanged → void Function(dynamic)?
Callback when auth state changes
final
redirectOnLogin String?
Route to redirect to after successful login
final
redirectOnLogout String?
Route to redirect to after logout
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverApiUrl String?
Server API URL for user sync (e.g., 'https://api.example.com')
final

Methods

createElement() Element
Creates a StatefulElement to manage this component's location in the tree.
inherited
createState() State<ArcaneAuthProvider>
Creates the mutable state for this component at a given location in the tree.
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