InputDecoratorModifier 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. The child
widget,
as well as the decorative widgets specified in decoration, must have
non-negative baselines.
See also:
- TextField, which uses an InputDecorator to display a border, labels, and icons, around its EditableText child.
- Decoration and DecoratedBox, for drawing arbitrary decorations around other widgets.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SingleChildStatelessModifier
- InputDecoratorModifier
- Available extensions
Constructors
- InputDecoratorModifier({Key? key, Key? modifierKey, required InputDecoration decoration, TextStyle? baseStyle, TextAlign? textAlign, TextAlignVertical? textAlignVertical, bool isFocused = false, bool isHovering = false, bool expands = false, bool isEmpty = false})
-
Creates a widget that displays a border, labels, and icons,
for a TextField.
const
Properties
- baseStyle → TextStyle?
-
The style on which to base the label, hint, counter, and error styles
if the decoration does not provide explicit styles.
final
- decoration → InputDecoration
-
The text and styles to use when decorating the child.
final
- expands → bool
-
If true, the height of the input field will be as large as possible.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether the input field is empty.
final
- isFocused → bool
-
Whether the input field has focus.
final
- isHovering → bool
-
Whether the input field is being hovered over by a mouse pointer.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- modifierKey → Key?
-
The actual key of the widget, which Modifier wrapped
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textAlign → TextAlign?
-
How the text in the decoration should be aligned horizontally.
final
- textAlignVertical → TextAlignVertical?
-
How the text should be aligned vertically.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
buildWithChild(
BuildContext context, Widget? child) → Widget -
A build method that receives an extra
child
parameter.override -
createElement(
) → SingleChildStatelessElement -
Create a SingleChildStatelessElement
inherited
-
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