InputDecoration constructor

const InputDecoration({Widget icon, String labelText, TextStyle labelStyle, String helperText, TextStyle helperStyle, String hintText, TextStyle hintStyle, int hintMaxLines, String errorText, TextStyle errorStyle, int errorMaxLines, bool hasFloatingPlaceholder: true, bool isDense, EdgeInsetsGeometry contentPadding, Widget prefixIcon, Widget prefix, String prefixText, TextStyle prefixStyle, Widget suffixIcon, Widget suffix, String suffixText, TextStyle suffixStyle, Widget counter, String counterText, TextStyle counterStyle, bool filled, Color fillColor, Color focusColor, Color hoverColor, InputBorder errorBorder, InputBorder focusedBorder, InputBorder focusedErrorBorder, InputBorder disabledBorder, InputBorder enabledBorder, InputBorder border, bool enabled: true, String semanticCounterText, bool alignLabelWithHint })

Creates a bundle of the border, labels, icons, and styles used to decorate a Material Design text field.

Unless specified by ThemeData.inputDecorationTheme, InputDecorator defaults isDense to true, and filled to false, and maxLines to 1. The default border is an instance of UnderlineInputBorder. If border is InputBorder.none then no border is drawn.

The enabled argument must not be null.

Only one of prefix and prefixText can be specified.

Similarly, only one of suffix and suffixText can be specified.

Implementation

const InputDecoration({
  this.icon,
  this.labelText,
  this.labelStyle,
  this.helperText,
  this.helperStyle,
  this.hintText,
  this.hintStyle,
  this.hintMaxLines,
  this.errorText,
  this.errorStyle,
  this.errorMaxLines,
  this.hasFloatingPlaceholder = true,
  this.isDense,
  this.contentPadding,
  this.prefixIcon,
  this.prefix,
  this.prefixText,
  this.prefixStyle,
  this.suffixIcon,
  this.suffix,
  this.suffixText,
  this.suffixStyle,
  this.counter,
  this.counterText,
  this.counterStyle,
  this.filled,
  this.fillColor,
  this.focusColor,
  this.hoverColor,
  this.errorBorder,
  this.focusedBorder,
  this.focusedErrorBorder,
  this.disabledBorder,
  this.enabledBorder,
  this.border,
  this.enabled = true,
  this.semanticCounterText,
  this.alignLabelWithHint,
}) : assert(enabled != null),
     assert(!(prefix != null && prefixText != null), 'Declaring both prefix and prefixText is not supported.'),
     assert(!(suffix != null && suffixText != null), 'Declaring both suffix and suffixText is not supported.'),
     isCollapsed = false;