VerificationController class

State + behaviour of the verification dialog, independent of how it is drawn. The dialog widget listens to this and asks the active AuthyoStyle to render each slot.

Inheritance

Constructors

VerificationController({required String to, required AuthyoResult sendResult, required int resendTimerSeconds, required AuthyoWidgetConfig config, int? otpLength, bool rememberMeEnabled = false, AuthyoService? service})

Properties

attempts AuthyoAttempts?
"N of M attempts remaining" from the last send / failed verify, if the server reports it.
getter/setter pair
canResend bool
True once the OTP has expired: the resend options replace the timer.
getter/setter pair
completed AuthyoResult?
Set once verification (OTP or social) succeeds.
getter/setter pair
config AuthyoWidgetConfig
Remote configuration (channels, social logins…).
final
countdownLabel String
m:ss countdown label.
no setter
countdownSeconds int
Seconds the countdown starts from.
no setter
errorMessage String?
Last error message to surface to the user (cleared on next action).
getter/setter pair
expiryFraction double
Fraction of the OTP lifetime left (1 -> 0).
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
infoMessage String?
Last informational message (e.g. "OTP sent").
getter/setter pair
isEmail bool
no setter
isLoading bool
getter/setter pair
lastChannel AuthwayEnum?
Channel the current code went out on, so "Resend OTP" during the countdown repeats it; null lets the server pick.
getter/setter pair
lockedOut bool
Set when the server locked the session after too many wrong codes. The dialog shows lockoutMessage and leaves, like the widget resets to its home screen.
getter/setter pair
lockoutMessage String
Text shown when the server locks the session.
no setter
maskedTarget String
+91XXXXXX1234 / abXXXX@domain for the "sent to" line.
no setter
maskId String?
getter/setter pair
otp String
getter/setter pair
otpError String?
Red line under the OTP boxes after a wrong code (cleared on the next keystroke / resend), like the widget's inline "Invalid OTP" text.
getter/setter pair
otpLength int?
Expected OTP length, used to cap the input. Null = unknown.
final
rememberMe bool
"Remember me" checkbox state.
getter/setter pair
rememberMeEnabled bool
Dashboard "Remember me" option (from the resolved theme). When false the checkbox is never shown, the flag is never sent and nothing is stored on the device.
final
resendChannels List<AuthwayEnum>
Channels offered for "resend". Uses the dashboard configuration when available; falls back to every channel valid for the target type.
no setter
resendCooldownSeconds int
Seconds the resend cooldown starts from (dashboard timer, else 60).
no setter
resendFraction double
Fraction of the resend cooldown still to wait (1 -> 0).
no setter
resendReady bool
True while the "Resend OTP" button may be pressed.
no setter
resendRemaining int
Resend cooldown, deliberately separate from the expiry above (same as the web widget): how soon a fresh code may be requested, not how long the current one stays valid. The server enforces 60s regardless of the dashboard timer, so 60 is the floor the bar counts down from.
getter/setter pair
resendTimerSeconds int
Dashboard "resend button timer" (seconds, 0 = not set). Like the web widget it is sent to the server as the new expiry when resending and used as the countdown only when the server reply carries no expiry.
final
resendTotal int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondsRemaining int
getter/setter pair
socialLogins List<AuthyoSocialLogin>
no setter
to String
Phone number or email the OTP was sent to.
final
verified bool
True after a successful verification (OTP or social) while the success badge is shown.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearOtpError() → void
Clears the inline error when the user starts typing again.
dispose() → void
Discards any resources used by the object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resend(AuthwayEnum? channel) Future<AuthyoResult>
Requests a fresh code. channel null repeats the channel the current code went out on (what the widget's "Resend OTP" button does); the expired screen passes the channel the user picked.
social(AuthyoSocialLogin login) Future<AuthyoResult>
start() → void
stopTimers() → void
Stops every countdown (verified, locked out, or leaving).
toString() String
A string representation of this object.
inherited
verify() Future<AuthyoResult>

Operators

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

Static Methods

formatMmSs(int seconds) String
m:ss of an arbitrary number of seconds.