VerificationCodeInput class
A widget for entering one-time verification codes (OTP).
Displays a row of pin inputs. The callback onCompleted is invoked when the input reaches the configured length.
On the web, the browser context menu is disabled while the input has focus or is pressed, so a long press or right click on it shows Flutter's text selection toolbar, which has a paste action. The browser context menu is restored when the input loses focus, unless the app had disabled it itself. The page also gets a style that keeps iOS Safari from zooming in when the input is tapped.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- VerificationCodeInput
Constructors
- VerificationCodeInput({required VoidCallback onCompleted, required TextEditingController verificationCodeController, required bool isLoading, int length = 8, TextInputType keyboardType = TextInputType.text, LetterCase allowedLetterCase = LetterCase.mixed, Pattern? allowedCharactersPattern, FocusNode? focusNode, Key? key})
-
Creates a VerificationCodeInput widget.
const
Properties
- allowedCharactersPattern → Pattern?
-
A pattern of the allowed characters in the verification code input.
final
- allowedLetterCase → LetterCase
-
The case of letters allowed in the verification code input.
final
- focusNode → FocusNode?
-
The focus node for the verification code input.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLoading → bool
-
When true, disables input while an operation is in progress.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType
-
The keyboard type to use for the verification code input.
final
- length → int
-
Number of digits/characters expected for the code. Defaults to 6.
final
- onCompleted → VoidCallback
-
Callback invoked when the code entry is complete.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- verificationCodeController → TextEditingController
-
Controller that holds the entered verification code.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< VerificationCodeInput> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
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
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited