InputField class

An input field from the Eufemia design system.

Inheritance

Constructors

InputField({Key key, TextEditingController controller, int maxLines: 1, int maxLength, dynamic validator(String), dynamic onChanged(String), VoidCallback onEditingComplete, String errorText, TextInputType keyboardType, bool autocorrect: true, bool readOnly: false, bool multiline: false, bool expands: false, bool counter: true, bool autofocus: false, String hintText, String label, bool obscureText: false, FocusNode focusNode, bool enableSuggestions: true, VoidCallback onTap, TextInputAction textInputAction, dynamic onFieldSubmitted(String), List<TextInputFormatter> inputFormatters, bool hideBorders: false, TextStyle style, TextStyle labelStyle, Alignment counterAlignment: Alignment.bottomRight, String suffixText, TextStyle suffixStyle, TextStyle prefixStyle, String prefixText, Widget prefix, Widget suffix})
const

Properties

autocorrect bool
If the system's autocorrect should be enabled for this field.
final
autofocus bool
If this field should receive focus automatically.
final
controller TextEditingController
The TextEditingController used control and modify this field.
final
counter bool
If this field should display a character counter.
final
counterAlignment Alignment
Optional Alignment for the counter label. Defaults to Alignment.bottomRight
final
enableSuggestions bool
If the system keyboard should enable suggestions for this field.
final
errorText String
The text to display on validation errors.
final
expands bool
If this field can expand.
final
focusNode FocusNode
An optional focus node to use as the focus node for this widget. [...]
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
hideBorders bool
If the surrounding borders should be hidden.
final
hintText String
The hint text to display before the field is modified. Disappears once text is entered in the field.
final
inputFormatters List<TextInputFormatter>
Validators for formatting as-you-type.
final
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
keyboardType TextInputType
The type of keyboard to display when this field is tapped.
final
label String
The label to display above the field. Will not go away once user starts to type.
final
labelStyle TextStyle
The optional TextStyle applied to label.
final
maxLength int
The max length of the input string.
final
maxLines int
The max amount of lines available.
final
multiline bool
If this field should accept multiple lines of input.
final
obscureText bool
If the input text should be obscured.
final
onChanged → dynamic Function(String)
Callback function that is called when the value changes. Passes the updated value as a parameter.
final
onEditingComplete VoidCallback
The callback function that is called when the field has been edited.
final
onFieldSubmitted → dynamic Function(String)
The callback function that is called when the field has been submitted by the user pressing the keyboard's action button.
final
onTap VoidCallback
Callback function called when the component has been tapped
final
prefix Widget
A widget to prefix the input.
final
prefixStyle TextStyle
The TextStyle applied to prefixText
final
prefixText String
The suffix text to prefix the input with.
final
readOnly bool
If this field should be read-only.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
style TextStyle
Optional TextStyle for custom typography.
final
suffix Widget
A widget to suffix the input.
final
suffixStyle TextStyle
The TextStyle applied to suffixText
final
suffixText String
The suffix text to display after the input.
final
textInputAction TextInputAction
The type of action to display on the system keyboard.
final
validator → dynamic Function(String)
The validator function that is called on form validation. Should return the error text to display.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
createState() → _InputFieldState
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. [...]
@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.info}) 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 ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited