OtpFieldsRow class

A row of OTP input fields

Inheritance

Constructors

OtpFieldsRow.new({Key? key, required List<TextEditingController> controllers, required List<FocusNode> focusNodes, required List<OtpFieldState> fieldStates, required List<bool> fieldHasError, required dynamic onDigitChanged(String, int), required OtpFieldConfig config, required FieldColors getFieldColors(int, OtpFieldState, bool), required List<TextInputFormatter> inputFormatters, required TextInputType keyboardType, required FormFieldValidator<String>? validator, required OtpLayoutType layoutType, required int fieldCount, required double fieldSpacing, required TextAlign cursorAlignment, bool obscureText = false, String obscuringCharacter = '•', bool enableInteractiveSelection = true, TextCapitalization textCapitalization = TextCapitalization.none, bool hasInternalError = false, OtpAnimationConfig animationConfig = const OtpAnimationConfig(), List<AnimationController>? fieldAnimationControllers, CursorStyle? cursorStyleOverride})
Creates a new OTP fields row
const

Properties

animationConfig OtpAnimationConfig
Animation configuration for the fields
final
config OtpFieldConfig
Configuration for the fields
final
controllers List<TextEditingController>
Text controllers for the fields
final
cursorAlignment TextAlign
Alignment of the cursor within the field
final
cursorStyleOverride CursorStyle?
Optional global cursor style override (from OtpKit)
final
enableInteractiveSelection bool
Whether to enable interactive selection
final
fieldAnimationControllers List<AnimationController>?
Animation controllers for individual fields
final
fieldCount int
Number of fields
final
fieldHasError List<bool>
Whether each field has an error
final
fieldSpacing double
Spacing between fields
final
fieldStates List<OtpFieldState>
States of the fields
final
focusNodes List<FocusNode>
Focus nodes for the fields
final
getFieldColors FieldColors Function(int, OtpFieldState, bool)
Function to get field colors based on state
final
hashCode int
The hash code for this object.
no setterinherited
hasInternalError bool
Whether the widget has an internal error
final
inputFormatters List<TextInputFormatter>
Input formatters for the fields
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType
Keyboard type for the fields
final
layoutType OtpLayoutType
Layout type for the fields
final
obscureText bool
Whether to obscure the text
final
obscuringCharacter String
Character to use for obscuring text
final
onDigitChanged → dynamic Function(String, int)
Callback when a digit changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textCapitalization TextCapitalization
Text capitalization for the fields
final
validator FormFieldValidator<String>?
Validator function for the fields
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<OtpFieldsRow>
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