Text and styles used to label an input field.

The TextField and InputDecorator classes use InputDecoration objects to describe their decoration. (In fact, this class is merely the configuration of an InputDecorator, which does all the heavy lifting.)

See also:

Annotations
  • @immutable

Constructors

InputDecoration({Widget icon, String labelText, TextStyle labelStyle, String helperText, TextStyle helperStyle, String hintText, TextStyle hintStyle, String errorText, TextStyle errorStyle, bool isDense: false, bool hideDivider: false, String prefixText, TextStyle prefixStyle, String suffixText, TextStyle suffixStyle, String counterText, TextStyle counterStyle })
Creates a bundle of text and styles used to label an input field. [...]
const
InputDecoration.collapsed({@required String hintText, TextStyle hintStyle })
Creates a decoration that is the same size as the input field. [...]
const

Properties

counterStyle TextStyle
The style to use for the counterText. [...]
final
counterText String
Optional text to place below the line as a character count. [...]
final
errorStyle TextStyle
The style to use for the errorText. [...]
final
errorText String
Text that appears below the input field. [...]
final
hashCode int
The hash code for this object. [...]
read-only
helperStyle TextStyle
The style to use for the helperText.
final
helperText String
Text that provides context about the field’s value, such as how the value will be used. [...]
final
hideDivider bool
Whether to hide the divider below the input field and above the error text. [...]
final
hintStyle TextStyle
The style to use for the hintText. [...]
final
hintText String
Text that suggests what sort of input the field accepts. [...]
final
icon Widget
An icon to show before the input field. [...]
final
isCollapsed bool
Whether the decoration is the same size as the input field. [...]
final
isDense bool
Whether the input field is part of a dense form (i.e., uses less vertical space). [...]
final
labelStyle TextStyle
The style to use for the labelText when the label is above (i.e., vertically adjacent to) the input field. [...]
final
labelText String
Text that describes the input field. [...]
final
prefixStyle TextStyle
The style to use for the prefixText. [...]
final
prefixText String
Optional text prefix to place on the line before the input. [...]
final
suffixStyle TextStyle
The style to use for the suffixText. [...]
final
suffixText String
Optional text suffix to place on the line after the input. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

copyWith({Widget icon, String labelText, TextStyle labelStyle, String helperText, TextStyle helperStyle, String hintText, TextStyle hintStyle, String errorText, TextStyle errorStyle, bool isDense, bool hideDivider, String prefixText, TextStyle prefixStyle, String suffixText, TextStyle suffixStyle, String counterText, TextStyle counterStyle }) InputDecoration
Creates a copy of this input decoration but with the given fields replaced with the new values. [...]
toString() String
Returns a string representation of this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

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