InputDecorator class

Defines the appearance of a Material Design text field.

InputDecorator displays the visual elements of a Material Design text field around its input child. The visual elements themselves are defined by an InputDecoration object and their layout and appearance depend on the baseStyle, textAlign, isFocused, and isEmpty parameters.

TextField uses this widget to decorate its EditableText child.

InputDecorator can be used to create widgets that look and behave like a TextField but support other kinds of input.

Requires one of its ancestors to be a Material widget.

See also:



InputDecorator({Key key, InputDecoration decoration, TextStyle baseStyle, TextAlign textAlign, bool isFocused: false, bool isEmpty: false, Widget child })
Creates a widget that displays a border, labels, and icons, for a TextField. [...]


baseStyle TextStyle
The style on which to base the label, hint, counter, and error styles if the decoration does not provide explicit styles. [...]
child Widget
The widget below this widget in the tree. [...]
decoration InputDecoration
The text and styles to use when decorating the child. [...]
isEmpty bool
Whether the input field is empty. [...]
isFocused bool
Whether the input field has focus. [...]
textAlign TextAlign
How the text in the decoration should be aligned horizontally.
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


createState() → _InputDecoratorState
Creates the mutable state for this widget at a given location in the tree. [...]
debugFillProperties(DiagnosticPropertiesBuilder description) → void
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDiagnosticsNode({String name, DiagnosticsTreeStyle style }) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by toStringDeep. [...]
toString({DiagnosticLevel minLevel: DiagnosticLevel.debug }) String
Returns a string representation of this object.
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug }) String
Returns a string representation of this node and its descendants. [...]
toStringShallow({String joiner: ', ', DiagnosticLevel minLevel: DiagnosticLevel.debug }) String
Returns a one-line detailed description of the object. [...]
toStringShort() String
A short, textual description of this widget.


operator ==(other) bool
The equality operator. [...]

Static Methods

containerOf(BuildContext context) RenderBox
The RenderBox that defines this decorator's "container". That's the area which is filled if InputDecoration.isFilled is true. It's the area adjacent to InputDecoration.icon and above the widgets that contain InputDecoration.helperText, InputDecoration.errorText, and InputDecoration.counterText. [...]