PinCodeTextField class

Pin code text fields which automatically changes focus and validates

Constructors

PinCodeTextField({Key key, @required int length, TextEditingController controller, bool obsecureText: false, @required ValueChanged<String> onChanged, ValueChanged<String> onCompleted, Color backgroundColor: Colors.white, BorderRadius borderRadius, double fieldHeight: 50, double fieldWidth: 40, Color activeColor: Colors.green, Color selectedColor: Colors.blue, Color inactiveColor: Colors.red, Color disabledColor: Colors.grey, double borderWidth: 2, MainAxisAlignment mainAxisAlignment: MainAxisAlignment.spaceBetween, Duration animationDuration: const Duration(milliseconds: 150), Curve animationCurve: Curves.easeInOut, PinCodeFieldShape shape: PinCodeFieldShape.underline, AnimationType animationType: AnimationType.slide, TextInputType textInputType: TextInputType.visiblePassword, bool autoFocus: false, FocusNode focusNode, bool enabled: true, List<TextInputFormatter> inputFormatters: const [], String dialogContent: "Do you want to paste this code ", String dialogTitle: "Paste Code", String affirmativeText: "Paste", String negavtiveText: "Cancel", TextStyle textStyle: const TextStyle(fontSize: 20, color: Colors.black, fontWeight: FontWeight.bold) })

Properties

activeColor Color
Colors of the input fields which have inputs. Default is Colors.green
final
affirmativeText String
Affirmative action text for the AlertDialog. Default to "Paste"
final
animationCurve → Curve
Curve for the animation. Default is Curves.easeInOut
final
animationDuration Duration
Duration for the animation. Default is Duration(milliseconds: 150)
final
animationType AnimationType
AnimationType for the text to appear in the pin code field. Default is AnimationType.slide
final
autoFocus bool
If the pin code field should be autofocused or not. Default is false
final
backgroundColor Color
background color for the whole row of pin code fields. Default is Colors.white Can't be null or Colors.transparent
final
borderRadius → BorderRadius
Border radius of each pin code field
final
borderWidth double
Border width for the each input fields. Default is 2.0
final
controller → TextEditingController
TextEditingController to control the text manually. Sets a default TextEditingController() object if none given
final
dialogContent String
content of the AlertDialog while pasting the code. Default to "Do you want to paste this code "
final
dialogTitle String
title of the AlertDialog while pasting the code. Default to Paste Code
final
disabledColor Color
Colors of the input fields if the PinCodeTextField is disabled. Default is Colors.grey
final
enabled bool
Enable or disable the Field. Default is true
final
fieldHeight double
height for the pin code field. default is 50.0
final
fieldWidth double
width for the pin code field. default is 40.0
final
focusNode → FocusNode
Should pass a FocusNode to manage it from the parent
final
inactiveColor Color
Colors of the input fields which don't have inputs. Default is Colors.red
final
inputFormatters List<TextInputFormatter>
A list of TextInputFormatter that goes to the TextField
final
length int
length of how many cells there should be. 3-8 is recommended by me
final
mainAxisAlignment → MainAxisAlignment
This defines how the elements in the pin code field align. Default to MainAxisAlignment.spaceBetween
final
negavtiveText String
Negative action text for the AlertDialog. Default to "Cancel"
final
obsecureText bool
you already know what it does i guess :P default is false
final
onChanged → ValueChanged<String>
returns the current typed text in the fields
final
onCompleted → ValueChanged<String>
returns the typed text when all pins are set
final
selectedColor Color
Color of the input field which is currently selected. Default is Colors.blue
final
shape PinCodeFieldShape
this defines the shape of the input fields. Default is underlined
final
textInputType → TextInputType
TextInputType for the pin code fields. default is TextInputType.visiblePassword
final
textStyle → TextStyle
the style of the text, default is fontSize: 20, color: Colors.black, fontWeight: FontWeight.bold
final
hashCode int
The hash code for this object. [...]
read-only, inherited
key → Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() → _PinCodeTextFieldState
Creates the mutable state for this widget at a given location in the tree. [...]
createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.debug }) String
Returns 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 ==(dynamic other) bool
The equality operator. [...]
inherited