PinCodeFields class

Pin code fields widget

Inheritance

Constructors

PinCodeFields({int length = 4, EdgeInsets margin = const EdgeInsets.all(5.0), EdgeInsets padding = const EdgeInsets.only(bottom: 5.0), double? fieldHeight, double? fieldWidth, double borderWidth = 2.0, BorderRadius? borderRadius, Color borderColor = Colors.grey, Color activeBorderColor = Colors.blue, FieldBorderStyle fieldBorderStyle = FieldBorderStyle.bottom, Color fieldBackgroundColor = Colors.transparent, Color activeBackgroundColor = Colors.transparent, bool enabled = true, bool responsive = true, bool autofocus = false, TextStyle textStyle = const TextStyle(fontSize: 20.0), bool obscureText = false, String obscureCharacter = "*", TextInputType keyboardType = TextInputType.visiblePassword, List<TextInputFormatter>? inputFormatters, bool autoHideKeyboard = true, Animations animation = Animations.fade, Duration animationDuration = const Duration(milliseconds: 150), Curve animationCurve = Curves.easeInOut, Curve switchInAnimationCurve = Curves.easeIn, Curve switchOutAnimationCurve = Curves.easeOut, TextEditingController? controller, FocusNode? focusNode, ValueChanged<String>? onChange, required ValueChanged<String> onComplete, Iterable<String>? autofillHints})

Properties

activeBackgroundColor Color
Background color of the active pin code field Default active background color is Colors.transparent
final
activeBorderColor Color
Border color of the active pin code field Default active border color is Colors.blue
final
animation Animations
Animation for the text inside the fields Default animation is fade
final
animationCurve Curve
Animation curve Default is Curves.easeInOut
final
animationDuration Duration
Duration of the animation Default duration is Duration(milliseconds: 150)
final
autofillHints Iterable<String>?
A list of strings that helps the autofill service identify the type of this text input.
final
autofocus bool
Enable/ disable autofocus Default is false
final
autoHideKeyboard bool
Auto hide keyboard on complete Default is true
final
borderColor Color
Border color of the fields Default border color is Colors.grey
final
borderRadius BorderRadius?
Border radius of the fields
final
borderWidth double
Border width of the fields Default border width is 2.0
final
controller TextEditingController?
Text editing controller
final
enabled bool
Enable/ disable editing the fields Default is true
final
fieldBackgroundColor Color
Background color of the fields Default background color is Colors.transparent
final
fieldBorderStyle FieldBorderStyle
Border styles of the fields Default border style is FieldBorderStyle.bottom
final
fieldHeight double?
Height of the fields
final
fieldWidth double?
Width of the fields
final
focusNode FocusNode?
Focus node
final
hashCode int
The hash code for this object.
no setterinherited
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 Default keyboard type is TextInputType.visiblePassword
final
length int
Length of the pin code fields. Default length is 4
final
margin EdgeInsets
Margin between the fields. Default margin is EdgeInsets.all(5.0)
final
obscureCharacter String
Character to obscure the fields with. Default obscureCharacter is "*"
final
obscureText bool
Obscure text in the fields Default is false
final
onChange ValueChanged<String>?
Callback that returns text on change
final
onComplete ValueChanged<String>
Callback that return text on complete
final
padding EdgeInsets
Padding within a field Default padding is EdgeInsets.only(bottom: 5.0)
final
responsive bool
Adjust the size of the fields automatically to the available space Default is true
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
switchInAnimationCurve Curve
Switch in animation curve Default is Curves.easeIn
final
switchOutAnimationCurve Curve
Switch out animation curve /// Default is Curves.easeOut
final
textStyle TextStyle
Custom text style
final

Methods

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