OTPTextField class

Inheritance

Constructors

OTPTextField({Key? key, TextEditingController? controller, FocusNode? focusNode, void onCompleted(String)?, void onChanged(String)?, void onSubmitted(String)?, int length = 6, OTPStyle style = OTPStyle.boxed, OTPAnimationType animationType = OTPAnimationType.slide, double? pinWidth, double? pinHeight, double? spacing, double? borderRadius, double borderWidth = 1.5, Color? defaultBorderColor, Color? focusedBorderColor, Color? submittedBorderColor, Color? errorBorderColor, Color? successBorderColor, Color? fillColor, Color? focusedFillColor, Color? submittedFillColor, Color? errorFillColor, Color? successFillColor, Color? textColor, double? fontSize, FontWeight? fontWeight, String? fontFamily, TextStyle? textStyle, bool obscureText = false, String obscuringCharacter = '•', Widget? obscuringWidget, bool showCursor = true, Color? cursorColor, double cursorWidth = 2, double? cursorHeight, Widget? cursor, TextInputType keyboardType = TextInputType.number, TextInputAction textInputAction = TextInputAction.done, bool autofocus = false, bool readOnly = false, bool enabled = true, bool enableSuggestions = false, bool useNativeKeyboard = true, bool hapticFeedback = true, bool autoSubmit = false, bool closeKeyboardOnComplete = true, String? validator(String?)?, String? errorText, bool hasError = false, bool isSuccess = false, Duration errorAnimationDuration = const Duration(milliseconds: 300), bool showErrorAnimation = true, List<TextInputFormatter>? inputFormatters, Iterable<String>? autofillHints, bool enableIMEPersonalizedLearning = false, Widget contextMenuBuilder(BuildContext, EditableTextState)?, VoidCallback? onTap, VoidCallback? onLongPress, void onTapOutside(PointerDownEvent)?, MouseCursor? mouseCursor, bool forceErrorState = false, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, AlignmentGeometry pinContentAlignment = Alignment.center, Widget separatorBuilder(int index)?, Widget? preFilledWidget, PinTheme? followingPinTheme, PinTheme? disabledPinTheme, PinTheme? errorPinTheme, String? semanticLabel, bool? enableSecurity})
const

Properties

animationType → OTPAnimationType
final
autofillHints → Iterable<String>?
final
autofocus → bool
final
autoSubmit → bool
final
borderRadius → double?
final
borderWidth → double
final
closeKeyboardOnComplete → bool
final
contextMenuBuilder → Widget Function(BuildContext, EditableTextState)?
final
controller → TextEditingController?
final
crossAxisAlignment → CrossAxisAlignment
final
cursor → Widget?
final
cursorColor → Color?
final
cursorHeight → double?
final
cursorWidth → double
final
defaultBorderColor → Color?
final
disabledPinTheme → PinTheme?
final
enabled → bool
final
enableIMEPersonalizedLearning → bool
final
enableSecurity → bool?
final
enableSuggestions → bool
final
errorAnimationDuration → Duration
final
errorBorderColor → Color?
final
errorFillColor → Color?
final
errorPinTheme → PinTheme?
final
errorText → String?
final
fillColor → Color?
final
focusedBorderColor → Color?
final
focusedFillColor → Color?
final
focusNode → FocusNode?
final
followingPinTheme → PinTheme?
final
fontFamily → String?
final
fontSize → double?
final
fontWeight → FontWeight?
final
forceErrorState → bool
final
hapticFeedback → bool
final
hasError → bool
final
hashCode → int
The hash code for this object.
no setterinherited
inputFormatters → List<TextInputFormatter>?
final
isSuccess → bool
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType
final
length → int
final
mainAxisAlignment → MainAxisAlignment
final
mouseCursor → MouseCursor?
final
obscureText → bool
final
obscuringCharacter → String
final
obscuringWidget → Widget?
final
onChanged → void Function(String)?
final
onCompleted → void Function(String)?
final
onLongPress → VoidCallback?
final
onSubmitted → void Function(String)?
final
onTap → VoidCallback?
final
onTapOutside → void Function(PointerDownEvent)?
final
pinContentAlignment → AlignmentGeometry
final
pinHeight → double?
final
pinWidth → double?
final
preFilledWidget → Widget?
final
readOnly → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
final
separatorBuilder → Widget Function(int index)?
final
showCursor → bool
final
showErrorAnimation → bool
final
spacing → double?
final
style → OTPStyle
final
submittedBorderColor → Color?
final
submittedFillColor → Color?
final
successBorderColor → Color?
final
successFillColor → Color?
final
textColor → Color?
final
textInputAction → TextInputAction
final
textStyle → TextStyle?
final
useNativeKeyboard → bool
final
validator → String? Function(String?)?
final

Methods

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