InlineTextField class

A text widget, that let user inline edit the text it contains.

In view mode InlineTextField commonly looks like a Text widget. Initial text to display is defined in text parameter. Text appearance in view mode is defined by style parameter.

Instead of normal Text view, you can pass your custom widget in child parameter, which will be shown in the view mode.

By double tap, user switch on the editing mode, that is turning the widget to a TextField. Once text input submitted, the onEditingComplete callback is called, and InlineTextField back to display updated text. User can cancel editing by tap on build-in close icon button.

In editing mode you can customize input field using styleEditing and decoration. By default, the collapsed input decoration is used.

Note: InlineTextField must be used inside a Row or other horizontal flex widget, because it is expanded in its editing mode.

See also:

Inheritance

Constructors

InlineTextField({Key? key, Widget? child, InputDecoration? decoration, required void onEditingComplete(String value), TextStyle? style, TextStyle? styleEditing, String? text})
const

Properties

child Widget?
A widget to display in view mode
final
decoration InputDecoration?
The decoration to show around the text field.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onEditingComplete → void Function(String value)
Called when the user indicates that they are done editing the text in the field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style TextStyle?
The text style in view mode
final
styleEditing TextStyle?
The text style of TextField in the editing mode
final
text String?
Initial text value
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _InlineTextFieldState
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.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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.
inherited