AltogicState<T extends StatefulWidget> class
abstract
AltogicState is a State class that listens to initial links and provides redirect actions via overridable methods:
The methods are called only once when the initial link is received. Each method is triggered with the Redirect instance and the current BuildContext. The Redirect instance contains the link parameters: Redirect.action, Redirect.error, Redirect.status, and raw URL that Redirect created from Redirect.url.
If Redirect.error is not null, the process is invalid, and the Redirect instance contains the error message. E.g., on the oAuth provider link, if the user already exists with the same e-mail, the Redirect.error will contain the error message, and the status will be between 400 and 599.
If Redirect.status is between 200-299, the process is valid, and the action can be completed. ChangeEmailRedirect does not contain additional property. So If the Redirect.status is 200, this means that the e-mail is changed successfully.
The rest of the actions contains additional property RedirectWithToken.token that can be used to complete the process. For more information on how to complete the process, please see AltogicState.onMagicLink, AltogicState.onEmailVerificationLink, AltogicState.onPasswordResetLink, and AltogicState.onOauthProviderLink.
Constructors
Properties
- context → BuildContext
-
The location in the tree where this widget builds.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- mounted → bool
-
Whether this State object is currently in a tree.
no setterinherited
-
AltogicNavigatorObserver instance to track route changes and get the
current route's context.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widget → T
-
The current configuration.
no setterinherited
Methods
-
activate(
) → void -
Called when this object is reinserted into the tree after having been
removed via deactivate.
inherited
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
deactivate(
) → void -
Called when this object is removed from the tree.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
didChangeDependencies(
) → void -
Called when a dependency of this State object changes.
inherited
-
didUpdateWidget(
covariant T oldWidget) → void -
Called whenever the widget configuration changes.
inherited
-
dispose(
) → void -
Called when this object is removed from the tree permanently.
override
-
ensureContextInitialized(
) → Future< BuildContext> - In the some cases, the context is not initialized when the initial link is received. This method ensures that the context is initialized.
-
getWebRedirect(
String? route) → Redirect? - Creates Redirect from the route in WidgetsApp.onGenerateInitialRoutes.
-
initState(
) → void -
Called when this object is inserted into the tree.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onEmailChangeLink(
BuildContext context, ChangeEmailRedirect redirect) → void - This method is called when an email change link is launched. If the Redirect.status is 200, the email has been successfully changed. You can show a dialog or route to a new page to inform the user. Or nothing.
-
onEmailVerificationLink(
BuildContext context, EmailVerificationRedirect redirect) → void - This method is called when an email verification link is launched.
-
onMagicLink(
BuildContext context, MagicLinkRedirect redirect) → void - This method is called when a magic link is launched.
-
onOauthProviderLink(
BuildContext context, OauthRedirect redirect) → void - This method is called when an OAuth provider link is launched.
-
onPasswordResetLink(
BuildContext context, PasswordResetRedirect redirect) → void - This method is called when a password reset link is launched.
-
reassemble(
) → void -
Called whenever the application is reassembled during debugging, for
example during hot reload.
inherited
-
setState(
VoidCallback fn) → void -
Notify the framework that the internal state of this object has changed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
applicationInitialRedirect
→ Future<
Redirect?> -
Get the application's initial link redirect. This method returns
Redirect
instance if the deep link (on the initial link in the web) is Altogic redirect link.no setter