InputDecoration constructor
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 prefix
or prefixText
can be specified.
The same applies for suffix
and suffixText
.
Implementation
const InputDecoration({
this.icon,
this.labelText,
this.labelStyle,
this.helperText,
this.helperStyle,
this.hintText,
this.hintStyle,
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.counterText,
this.counterStyle,
this.filled,
this.fillColor,
this.errorBorder,
this.focusedBorder,
this.focusedErrorBorder,
this.disabledBorder,
this.enabledBorder,
this.border,
this.enabled = true,
this.semanticCounterText,
}) : assert(enabled != null),
assert(!(prefix != null && prefixText != null), 'Declaring both prefix and prefixText is not allowed'),
assert(!(suffix != null && suffixText != null), 'Declaring both suffix and suffixText is not allowed'),
isCollapsed = false;