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.greenfinal - affirmativeText → String
-
Affirmative action text for the
AlertDialog. Default to "Paste"final - animationCurve → Curve
-
Curvefor the animation. Default isCurves.easeInOutfinal - 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
falsefinal - backgroundColor → Color
-
background color for the whole row of pin code fields. Default is
Colors.whiteCan't be null orColors.transparentfinal - borderRadius → BorderRadius
-
Border radius of each pin code field
final
- borderWidth → double
-
Border width for the each input fields. Default is
2.0final - controller → TextEditingController
-
TextEditingControllerto control the text manually. Sets a defaultTextEditingController()object if none givenfinal - dialogContent → String
-
content of the
AlertDialogwhile pasting the code. Default to"Do you want to paste this code "final - dialogTitle → String
-
title of the
AlertDialogwhile pasting the code. Default toPaste Codefinal - disabledColor → Color
-
Colors of the input fields if the PinCodeTextField is disabled. Default is
Colors.greyfinal - enabled → bool
-
Enable or disable the Field. Default is
truefinal - fieldHeight → double
-
heightfor the pin code field. default is50.0final - fieldWidth → double
-
widthfor the pin code field. default is40.0final - focusNode → FocusNode
-
Should pass a
FocusNodeto manage it from the parentfinal - inactiveColor → Color
-
Colors of the input fields which don't have inputs. Default is
Colors.redfinal -
inputFormatters
→ List<
TextInputFormatter> -
A list of
TextInputFormatterthat goes to the TextFieldfinal - 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.spaceBetweenfinal - 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.bluefinal - shape → PinCodeFieldShape
-
this defines the shape of the input fields. Default is underlined
final
- textInputType → TextInputType
-
TextInputTypefor the pin code fields. default isTextInputType.visiblePasswordfinal - textStyle → TextStyle
-
the style of the text, default is
fontSize: 20, color: Colors.black, fontWeight: FontWeight.boldfinal - 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
StatefulElementto manage this widget's location in the tree. [...]inherited -
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNodeobjects 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