GlassPinField class
A one-time-code field: a row of glass boxes, one per character, over a single hidden text field. Characters pop into their boxes; the box awaiting the next one is outlined. A pasted or autofilled code fills every box at once.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GlassPinField
Constructors
-
GlassPinField.new({Key? key, int length = 6, TextEditingController? controller, FocusNode? focusNode, ValueChanged<
String> ? onChanged, ValueChanged<String> ? onCompleted, bool obscure = false, bool error = false, bool enabled = true, bool autofocus = false, bool digitsOnly = true, TextInputType? keyboardType, double boxWidth = 44, double boxHeight = 52, double spacing = 8, String? semanticLabel}) -
Creates a code field;
lengthmust be positive.const
Properties
- autofocus → bool
-
Whether it takes focus when first built.
final
- boxHeight → double
-
Each box's height.
final
- boxWidth → double
-
Each box's width.
final
- controller → TextEditingController?
-
Holds the code. Creates its own if null.
final
- digitsOnly → bool
-
Takes only the digits 0 to 9, dropping anything else typed or pasted.
final
- enabled → bool
-
Whether it takes input.
final
- error → bool
-
Tints the boxes with the theme's destructive colour, and shakes them
when it turns on.
final
- focusNode → FocusNode?
-
The control's focus node, to drive or watch its focus.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType?
-
The keyboard to ask for; a number pad for digitsOnly.
final
- length → int
-
How many characters the code has.
final
- obscure → bool
-
Shows a dot in place of each character.
final
-
onChanged
→ ValueChanged<
String> ? -
Called as the code is typed or deleted.
final
-
onCompleted
→ ValueChanged<
String> ? -
Called when the last box fills.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Names the field for assistive technology.
final
- spacing → double
-
The gap between boxes.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< GlassPinField> -
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