OudsPinCodeInput class
OUDS PIN Code Input Design Guidelines
Reference design version : 1.3.0
A fixed-length PIN code input composed of individual digit cells, typically used for authentication or confirmation flows.
Architecture
A single invisible TextField captures all keyboard input and holds the full PIN string, keeping the soft keyboard open and stable across all cell transitions. The visual cells (OudsDigitInput) are purely decorative.
Accessibility
When any platform accessibility feature is active (screen reader, bold text, high contrast, reduced motion, …) the component switches to an accessibility-friendly mode:
- No automatic focus advance — the user moves to the next cell manually.
- Cell-by-cell deletion — backspace clears only the selected cell.
- Live regions disabled — prevents the screen reader from jumping to cells whose content changed after a keystroke.
Example
OudsPinCodeInput(
length: OudsPinCodeInputLength.six,
helperText: 'Enter your 6-digit code',
digitInputDecoration: OudsDigitInputDecoration(
hintText: '-',
hiddenPassword: true,
),
onChanged: (value) => print('Current PIN: $value'),
onEditingComplete: (value) => print('PIN complete: $value'),
)
Parameters:
- length: Number of digit cells. Defaults to OudsPinCodeInputLength.six.
- helperText: Supporting text shown below the input.
- errorText: Error message shown below the input; also sets the error state.
- controllers: Optional per-cell controllers for reading individual values.
- onEditingComplete: Called with the full PIN when all cells are filled.
- onChanged: Called with the current PIN on every keystroke.
- digitInputDecoration: Visual and keyboard configuration for the cells.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OudsPinCodeInput
Constructors
-
OudsPinCodeInput({Key? key, OudsPinCodeInputLength length = OudsPinCodeInputLength.six, String? helperText, String? errorText, List<
TextEditingController> ? controllers, void onEditingComplete(String)?, void onChanged(String)?, required OudsDigitInputDecoration digitInputDecoration}) -
const
Properties
-
controllers
→ List<
TextEditingController> ? -
final
- digitInputDecoration → OudsDigitInputDecoration
-
final
- errorText → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- helperText → String?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- length → OudsPinCodeInputLength
-
final
- onChanged → void Function(String)?
-
final
- onEditingComplete → void Function(String)?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< OudsPinCodeInput> -
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