OtpTextField class

Inheritance

Constructors

OtpTextField.new({bool showCursor = true, int numberOfFields = 4, double fieldWidth = 40.0, double? fieldHeight, Alignment? alignment, EdgeInsetsGeometry margin = const EdgeInsets.only(right: 8.0), TextStyle? textStyle, bool clearText = false, List<TextStyle?> styles = const [], TextInputType keyboardType = TextInputType.number, double borderWidth = 2.0, Color? cursorColor, Color disabledBorderColor = const Color(0xFFE7E7E7), Color enabledBorderColor = const Color(0xFFE7E7E7), Color borderColor = const Color(0xFFE7E7E7), Color focusedBorderColor = const Color(0xFF4F44FF), MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, HandleControllers? handleControllers, OnCodeEnteredCompletion? onSubmit, bool obscureText = false, bool showFieldAsBox = false, bool enabled = true, bool autoFocus = false, bool hasCustomInputDecoration = false, bool filled = false, Color fillColor = const Color(0xFFFFFFFF), bool readOnly = false, InputDecoration? decoration, OnCodeEnteredCompletion? onCodeChanged, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)), List<TextInputFormatter>? inputFormatters, EdgeInsetsGeometry? contentPadding})

Properties

alignment Alignment?
aligns text fields in container
final
autoFocus bool
handles autoFocus
final
borderColor Color
handles color of border
final
borderRadius BorderRadius
sets borderRadius of textField
final
borderWidth double
border width of each text field
final
clearText bool
clears text
getter/setter pair
contentPadding EdgeInsetsGeometry?
handles contentPadding for each textField
final
crossAxisAlignment CrossAxisAlignment
handles crossAxisAlignment of textFields in Row
final
cursorColor Color?
handles color of cursor
final
decoration InputDecoration?
sets InputDecoration
final
disabledBorderColor Color
color of disabled border
final
enabled bool
if true, sets textFields to enabled
final
enabledBorderColor Color
color of enabled border
final
fieldHeight double?
height of each text field
final
fieldWidth double
width of each text field
final
fillColor Color
sets fill color of textField
final
filled bool
If true the decoration's container is filled with fillColor.
final
focusedBorderColor Color
color of focused border
final
handleControllers HandleControllers?
textEditing controller handler
final
hasCustomInputDecoration bool
if true, custom Input decoration that is passed in takes effect
final
hashCode int
The hash code for this object.
no setterinherited
inputFormatters List<TextInputFormatter>?
sets inputFormatters for textFields
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType
controls keyboard type
final
mainAxisAlignment MainAxisAlignment
handles mainAxisAlignment of textFields in Row
final
margin EdgeInsetsGeometry
handles margin in between text fields
final
numberOfFields int
specify number of fields, defaults to 4
final
obscureText bool
handles visibility of text in textField
final
onCodeChanged OnCodeEnteredCompletion?
callBack called when code in textField changes
final
onSubmit OnCodeEnteredCompletion?
callBack called when last textField is filled
final
readOnly bool
if true, sets content of textField to be readOnly
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCursor bool
allows to show or disable cursor
final
showFieldAsBox bool
if true, uses outlineBorder, if false underlineBorder
final
styles List<TextStyle?>
sets custom styles for textFields
final
textStyle TextStyle?
handles textStyle of digit in textField
final

Methods

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