OudsPinCodeInput class

OUDS Pin Code Input design guidelines

A PIN code input is a specialized form field used to capture short, fixed-length numeric codes, typically for authentication or confirmation purposes, such as a 4, 6 or 8-digit personal identification number (PIN).

It is often presented as a series of individual input fields or boxes, each representing a single digit, to enhance readability and encourage accurate input.

This component must support smooth keyboard navigation (automatic focus shift, backspace handling), secure input masking if needed. It is commonly used in sensitive flows like login, verification, or transaction confirmation.

Parameters:

  • length: Defines the fixed number of digits required for the PIN code , Example OudsPinCodeInputLength.six.value
  • helperText Supporting text conveys additional information about the input field, such as how it will be used. eg. 'Enter the 4-digit code sent to your phone.'.
  • errorText: Text shown below the input indicating an error state or invalid input.
  • controllers: List of controllers managing the text of each digit input field.
  • onEditingComplete: Callback triggered when the PIN input is completely filled. Provides the concatenated PIN value as a string.
  • onChanged: Callback triggered when the pin code value changes. Provides the new value of the pin code input.
  • digitInputDecoration: Defines the decoration of each digit input box OudsDigitInputDecoration

You can use OudsPinCodeInput like this :

OudsPinCodeInput(
  controllers: controllers,
  helperText: "Please enter the 4-digit code sent to your phone.",
  style: OudsTextInputStyle.defaultStyle,
  length: OudsPinCodeInputLength.four,
  digitInputDecoration: OudsDigitInputDecoration(
       hintText : "-",
       roundedCorner: true,
       style: OudsTextInputStyle.defaultStyle
       ),
   onEditingComplete: (value){},
   onChanged: (value){},
     );
Inheritance

Constructors

OudsPinCodeInput.new({Key? key, OudsPinCodeInputLength length = OudsPinCodeInputLength.six, String? helperText, String? errorText, List<TextEditingController>? controllers, void onEditingComplete(String)?, void onChanged(String)?, required OudsDigitInputDecoration digitInputDecoration})

Properties

controllers List<TextEditingController>?
final
digitInputDecoration OudsDigitInputDecoration
final
errorText String?
getter/setter pair
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