A simple undecorated text input field.
If you want decorations as specified in the Material spec (most likely), use Input instead.
This widget is comparable to Text in that it does not include a margin or any decoration outside the text itself. It is useful for applications, like a search box, that don't need any additional decoration. It should also be useful in custom widgets that support text input.
The value field must be updated each time the onChanged callback is invoked. Be sure to include the full value provided by the onChanged callback, or information like the current selection will be lost.
Requires one of its ancestors to be a Material widget.
See also:
- Inheritance
- Object
- Widget
- StatefulWidget
- InputField
Constructors
- InputField({Key key, GlobalKey focusKey, InputValue value, TextInputType keyboardType: TextInputType.text, String hintText, TextStyle style, bool hideText: false, int maxLines: 1, bool autofocus: false, ValueChanged<InputValue> onChanged, ValueChanged<InputValue> onSubmitted })
Properties
- autofocus → bool
-
Whether this input field should focus itself if nothing else is already focused.
read-only - focusKey → GlobalKey
-
read-only
- hideText → bool
-
Whether to hide the text being edited (e.g., for passwords).
read-only - hintText → String
-
Text to show inline in the input field when it would otherwise be empty.
read-only - keyboardType → TextInputType
-
The type of keyboard to use for editing the text.
read-only - maxLines → int
-
The maximum number of lines for the text to span, wrapping if necessary. If this is 1 (the default), the text will not wrap, but will scroll horizontally instead.
read-only - onChanged → ValueChanged<InputValue>
-
Called when the text being edited changes.
read-only - onSubmitted → ValueChanged<InputValue>
-
Called when the user indicates that they are done editing the text in the field.
read-only - style → TextStyle
-
The style to use for the text being edited.
read-only - value → InputValue
-
The current state of text of the input field. This includes the selected text, if any, among other things.
read-only - hashCode → int
-
Get a hash code for this object.
read-only, inherited - key → Key
-
Controls how one widget replaces another widget in the tree.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
createState(
) → _InputFieldState -
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 -
debugFillDescription(
List<String> description) → void -
Add additional information to the given description for use by toString.
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited -
toStringShort(
) → String -
A short, textual description of this widget.
inherited