FormFieldControl
Inherits: LayoutControl
Properties
-
align_label_with_hint
(bool | None
) –TBD
-
bgcolor
(ColorValue | None
) –TextField background color.
-
border
(InputBorder
) –Border around input.
-
border_color
(ColorValue | None
) –The border color.
-
border_radius
(BorderRadiusValue | None
) – -
border_width
(Number | None
) –The width of the border in virtual pixels.
-
collapsed
(bool | None
) –TBD
-
color
(ColorValue | None
) –Text color.
-
content_padding
(PaddingValue | None
) –The padding for the input decoration's container.
-
counter
(StrOrControl | None
) –A
Control
to place below the line as a character count. -
counter_style
(TextStyle | None
) –The text style to use for
counter
. -
dense
(bool | None
) –Whether this control is part of a dense form (ie, uses less vertical space).
-
error
(StrOrControl | None
) –Text that appears below the input border.
-
error_max_lines
(int | None
) –TBD
-
error_style
(TextStyle | None
) –The text style to use for
error
. -
fill_color
(ColorValue | None
) –Background color of TextField.
-
filled
(bool | None
) –If
True
the decoration's container is filled with theme -
fit_parent_size
(bool | None
) –TBD
-
focus_color
(ColorValue | None
) –TBD
-
focused_bgcolor
(ColorValue | None
) –Background color in focused state.
-
focused_border_color
(ColorValue | None
) –Border color in focused state.
-
focused_border_width
(Number | None
) –Border width in focused state.
-
focused_color
(ColorValue | None
) –The text's color when focused.
-
helper
(StrOrControl | None
) –Text that provides context about the input's value, such as how the value will be
-
helper_max_lines
(int | None
) –TBD
-
helper_style
(TextStyle | None
) –The text style to use for
helper
. -
hint_fade_duration
(DurationValue | None
) –TBD
-
hint_max_lines
(int | None
) –TBD
-
hint_style
(TextStyle | None
) –The text style to use for
hint_text
. -
hint_text
(str | None
) –Text that suggests what sort of input the field accepts.
-
hover_color
(ColorValue | None
) –Background color of TextField when hovered.
-
icon
(IconDataOrControl | None
) –The icon to show before the input field and outside of the decoration's container.
-
label
(StrOrControl | None
) –Optional text that describes the input field.
-
label_style
(TextStyle | None
) –The text style to use for
label
. -
prefix
(StrOrControl | None
) –A
Control
to place on the line before the input. -
prefix_icon
(IconDataOrControl | None
) –An icon that appears before the editable part of the text field,
-
prefix_icon_size_constraints
(BoxConstraints | None
) –TBD
-
prefix_style
(TextStyle | None
) –The text style to use for
prefix
. -
size_constraints
(BoxConstraints | None
) –TBD
-
suffix
(StrOrControl | None
) –A
Control
to place on the line after the input. -
suffix_icon
(IconDataOrControl | None
) –An icon that appears after the editable part of the text field and after the
-
suffix_icon_size_constraints
(BoxConstraints | None
) –TBD
-
suffix_style
(TextStyle | None
) –The text style to use for
suffix
. -
text_size
(Number | None
) –Text size in virtual pixels.
-
text_style
(TextStyle
) –The
TextStyle
to use for the -
text_vertical_align
(VerticalAlignment | Number | None
) –Defines how the text should be aligned vertically.
Methods
-
focus
–
Properties#
bgcolor
#
bgcolor: ColorValue | None = None
TextField background color.
Note
Will not be visible if filled
is False
.
border_color
#
border_color: ColorValue | None = None
The border color.
Tip
Set to Colors.TRANSPARENT
to invisible/hide the border.
border_width
#
border_width: Number | None = None
The width of the border in virtual pixels.
Defaults to 1
.
Tip
Set to 0
to completely remove the border.
content_padding
#
content_padding: PaddingValue | None = None
The padding for the input decoration's container.
counter
#
counter: StrOrControl | None = None
A Control
to place below the line as a character count.
If None
or an empty string then nothing will appear in the counter's location.
dense
#
dense: bool | None = None
Whether this control is part of a dense form (ie, uses less vertical space).
error
#
error: StrOrControl | None = None
Text that appears below the input border.
If non-null, the border's color animates to red
and the helper
is not shown.
fill_color
#
fill_color: ColorValue | None = None
Background color of TextField.
Note
Will not be visible if filled
is False
.
filled
#
filled: bool | None = None
If True
the decoration's container is filled with theme
fill_color
.
If filled=None
(the default), then it is implicitly set to True
when at least
one of the following is not None
: fill_color
,
focused_bgcolor
,
hover_color
and bgcolor
.
focused_bgcolor
#
focused_bgcolor: ColorValue | None = None
Background color in focused state.
Note
Will not be visible if filled
is False
.
focused_border_color
#
focused_border_color: ColorValue | None = None
Border color in focused state.
helper
#
helper: StrOrControl | None = None
hint_text
#
hint_text: str | None = None
Text that suggests what sort of input the field accepts.
Displayed on top of the input when the it's empty and either
(a) label
is None
or (b) the input has the focus.
hover_color
#
hover_color: ColorValue | None = None
Background color of TextField when hovered.
Note
Will not be visible if filled
is False
.
icon
#
icon: IconDataOrControl | None = None
The icon to show before the input field and outside of the decoration's container.
label
#
label: StrOrControl | None = None
Optional text that describes the input field.
When the input field is empty and unfocused, the label is displayed on top of the input field (i.e., at the same location on the screen where text may be entered in the input field). When the input field receives focus (or if the field is non-empty) the label moves above, either vertically adjacent to, or to the center of the input field.
prefix
#
prefix: StrOrControl | None = None
A Control
to place on the line before the input.
It appears after the prefix_icon
, if both are specified.
This can be used, for example, to add some padding to text that would otherwise be
specified using prefix
, or to add a custom control in front of the input.
The control's baseline is lined up with the input baseline.
prefix_icon
#
prefix_icon: IconDataOrControl | None = None
An icon that appears before the editable part of the text field, within the decoration's container.
If prefix
is specified and visible,
this icon will appear to its left.
suffix
#
suffix: StrOrControl | None = None
A Control
to place on the line after the input.
It appears before the suffix_icon
,
if both are specified.
This can be used, for example, to add some padding to the text that would otherwise
be specified using suffix
, or to add a custom control after the input.
The control's baseline is lined up with the input baseline.
suffix_icon
#
suffix_icon: IconDataOrControl | None = None
An icon that appears after the editable part of the text field and after the
suffix
, within the decoration's container.
text_vertical_align
#
text_vertical_align: VerticalAlignment | Number | None = (
None
)
Defines how the text should be aligned vertically.
Value can either be a number ranging from -1.0
(topmost location) to 1.0
(bottommost location) or of type VerticalAlignment
Defaults to VerticalAlignment.CENTER
.