TextInputSettingsTile class
--------- Common Settings widgets ---------- /// A Setting widget which allows user a text input in a TextFormField
This widget by default is a _ModalSettingsTile
. Meaning, this input field
will be shown in a dialog view.
Example:
TextInputSettingsTile(
title: 'User Name',
settingKey: 'key-user-name',
initialValue: 'admin',
validator: (String username) {
if (username != null && username.length > 3) {
return null;
}
return "User Name can't be smaller than 4 letters";
},
borderColor: Colors.blueAccent,
errorColor: Colors.deepOrangeAccent,
);
OR
TextInputSettingsTile(
title: 'password',
settingKey: 'key-user-password',
obscureText: true,
validator: (String password) {
if (password != null && password.length > 6) {
return null;
}
return "Password can't be smaller than 7 letters";
},
borderColor: Colors.blueAccent,
errorColor: Colors.deepOrangeAccent,
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TextInputSettingsTile
Constructors
-
TextInputSettingsTile({@required String title, @required String settingKey, String initialValue = '', bool enabled = true, AutovalidateMode autoValidateMode, bool autoFocus = true, OnChanged<
String> onChange, FormFieldValidator<String> validator, bool obscureText = false, Color borderColor, Color errorColor, TextInputType keyboardType})
Properties
- autoFocus → bool
-
flag which represents if the text field will be focused by default
or not
if true, then the text field will be in focus other wise it will not be
in focus by default, default = true
final
- autoValidateMode → AutovalidateMode
-
Validation mode helps use customize the way the input text field is
validated for proper input values.
final
- borderColor → Color
-
Color of the border of the TextFormField
final
- enabled → bool
-
flag which represents the state of the settings, if false the the tile will
ignore all the user inputs, default = true
final
- errorColor → Color
-
Color of the border of the TextFormField, when there's an error
or input is not passed through the validation
final
- hashCode → int
- The hash code for this object.
- initialValue → String
-
initial value to be filled in the text field, default = ''
final
- key → Key
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType
-
TextInputType of the TextFormField to set the keyboard type to name, phone, etc.
final
- obscureText → bool
-
flag which represents the state of obscureText in the TextFormField
default = false
final
-
onChange
→ OnChanged<
String> -
on change callback for handling the value change
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- settingKey → String
-
Settings Key string for storing the text in cache (assumed to be unique)
final
- title → String
-
title for the settings tile
final
-
validator
→ FormFieldValidator<
String> -
validator for input validation
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _TextInputSettingsTileState -
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.@protectedinherited -
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.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.
@nonVirtualinherited