FTextFormField class

A text field that is wrapped is a FormField for convenience.

It lets the user enter text, either with a hardware keyboard or with an onscreen keyboard.

See:

Inheritance
Mixed-in types

Constructors

FTextFormField({FTextFieldControl control = const .managed(), FTextFieldSizeVariant size = .md, FTextFieldStyleDelta style = const .context(), Widget builder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants, Widget field) = FTextField.defaultBuilder, Widget? label, String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = .none, TextAlign textAlign = .start, TextAlignVertical? textAlignVertical, TextDirection? textDirection, bool autofocus = false, WidgetStatesController? statesController, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, int? minLines, int? maxLines = 1, bool expands = false, bool readOnly = false, bool? showCursor, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, bool onTapAlwaysCalled = false, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmit, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool enabled = true, bool? ignorePointers, bool enableInteractiveSelection = true, bool? selectAllOnFocus, TextSelectionControls? selectionControls, DragStartBehavior dragStartBehavior = .start, MouseCursor? mouseCursor, FTextFieldCounterBuilder? counterBuilder, ScrollPhysics? scrollPhysics, ScrollController? scrollController, Iterable<String>? autofillHints, String? restorationId, bool stylusHandwritingEnabled = true, bool enableIMEPersonalizedLearning = true, ContentInsertionConfiguration? contentInsertionConfiguration, EditableTextContextMenuBuilder? contextMenuBuilder = FTextField.defaultContextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, Widget prefixBuilder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?, Widget suffixBuilder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?, bool clearable(TextEditingValue) = FTextField.defaultClearable, FFieldClearIconBuilder<FTextFieldStyle> clearIconBuilder = FTextField.defaultClearIconBuilder, FormFieldSetter<String>? onSaved, VoidCallback? onReset, FormFieldValidator<String>? validator, AutovalidateMode autovalidateMode = .disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, Key? formFieldKey, Key? key})
Creates a FTextFormField.
const
FTextFormField.email({FTextFieldControl control = const .managed(), FTextFieldSizeVariant size = .md, FTextFieldStyleDelta style = const .context(), Widget builder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants, Widget field) = FTextField.defaultBuilder, Widget? label = const LocalizedText.email(), String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, FocusNode? focusNode, TextInputType? keyboardType = .emailAddress, TextInputAction? textInputAction = .next, TextCapitalization textCapitalization = .none, TextAlign textAlign = .start, TextAlignVertical? textAlignVertical, TextDirection? textDirection, bool autofocus = false, WidgetStatesController? statesController, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = false, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, int? minLines, int? maxLines = 1, bool expands = false, bool readOnly = false, bool? showCursor, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, bool onTapAlwaysCalled = false, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmit, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool enabled = true, bool? ignorePointers, bool enableInteractiveSelection = true, bool? selectAllOnFocus, TextSelectionControls? selectionControls, DragStartBehavior dragStartBehavior = .start, MouseCursor? mouseCursor, FTextFieldCounterBuilder? counterBuilder, ScrollPhysics? scrollPhysics, ScrollController? scrollController, Iterable<String>? autofillHints = const [AutofillHints.email], String? restorationId, bool stylusHandwritingEnabled = true, bool enableIMEPersonalizedLearning = true, ContentInsertionConfiguration? contentInsertionConfiguration, EditableTextContextMenuBuilder? contextMenuBuilder = FTextField.defaultContextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, Widget prefixBuilder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?, Widget suffixBuilder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?, bool clearable(TextEditingValue) = FTextField.defaultClearable, FFieldClearIconBuilder<FTextFieldStyle> clearIconBuilder = FTextField.defaultClearIconBuilder, FormFieldSetter<String>? onSaved, VoidCallback? onReset, FormFieldValidator<String>? validator, AutovalidateMode autovalidateMode = .disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, Key? formFieldKey, Key? key})
Creates a FTextFormField configured for emails.
const
FTextFormField.multiline({FTextFieldControl control = const .managed(), FTextFieldSizeVariant size = .md, FTextFieldStyleDelta style = const .context(), Widget builder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants, Widget field) = FTextField.defaultBuilder, Widget? label, String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = .sentences, TextAlign textAlign = .start, TextAlignVertical? textAlignVertical, TextDirection? textDirection, bool autofocus = false, WidgetStatesController? statesController, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, int? minLines = 4, int? maxLines, bool expands = false, bool readOnly = false, bool? showCursor, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, bool onTapAlwaysCalled = false, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmit, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool enabled = true, bool? ignorePointers, bool enableInteractiveSelection = true, bool? selectAllOnFocus, TextSelectionControls? selectionControls, DragStartBehavior dragStartBehavior = .start, MouseCursor? mouseCursor, FTextFieldCounterBuilder? counterBuilder, ScrollPhysics? scrollPhysics, ScrollController? scrollController, Iterable<String>? autofillHints, String? restorationId, bool stylusHandwritingEnabled = true, bool enableIMEPersonalizedLearning = true, ContentInsertionConfiguration? contentInsertionConfiguration, EditableTextContextMenuBuilder? contextMenuBuilder = FTextField.defaultContextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, Widget prefixBuilder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?, Widget suffixBuilder(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?, bool clearable(TextEditingValue) = FTextField.defaultClearable, FFieldClearIconBuilder<FTextFieldStyle> clearIconBuilder = FTextField.defaultClearIconBuilder, FormFieldSetter<String>? onSaved, VoidCallback? onReset, FormFieldValidator<String>? validator, AutovalidateMode autovalidateMode = .disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, Key? formFieldKey, Key? key})
Creates a FTextFormField configured for multiline inputs.
const

Properties

autocorrect → bool
Whether to enable autocorrection. Defaults to true.
final
autofillHints → Iterable<String>?
A list of strings that helps the autofill service identify the type of this text input.
final
autofocus → bool
Whether this text field should focus itself if nothing else is already focused. Defaults to false.
final
autovalidateMode → AutovalidateMode
Used to enable/disable this form field's auto validation and update its error text.
final
builder → Widget Function(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants, Widget field)
The builder used to decorate the text-field. It should always use the given child.
final
canRequestFocus → bool
Determine whether this text field can request the primary focus.
final
clearable → bool Function(TextEditingValue)
A predicate that returns true if a clear icon should be shown at the end when the text field is not empty.
final
clearIconBuilder → FFieldClearIconBuilder<FTextFieldStyle>
The builder used to build the clear icon when clearable returns true.
final
contentInsertionConfiguration → ContentInsertionConfiguration?
Configuration of handler for media content inserted via the system input method.
final
contextMenuBuilder → EditableTextContextMenuBuilder?
Builds the text selection toolbar when requested by the user.
final
control → FTextFieldControl
Controls the text being edited.
final
counterBuilder → FTextFieldCounterBuilder?
The FTextFieldCounterBuilder used to build a custom counter for the text field.
final
description → Widget?
The description text.
final
dragStartBehavior → DragStartBehavior
Determines the way that drag start behavior is handled. By default, the drag start behavior is DragStartBehavior.start.
final
enabled → bool
If false the text field is "disabled": it ignores taps. Defaults to true.
final
enableIMEPersonalizedLearning → bool
Whether to enable that the IME update personalized data such as typing history and user dictionary data.
final
enableInteractiveSelection → bool
Whether to enable user interface affordances for changing the text selection. Defaults to true.
final
enableSuggestions → bool
Whether to show input suggestions as the user types. Defaults to true.
final
errorBuilder → Widget Function(BuildContext context, String message)
The builder for errors displayed below the description. Defaults to displaying the error message.
final
expands → bool
Whether this widget's height will be sized to fill its widget. Defaults to false.
final
focusNode → FocusNode?
Defines the keyboard focus for this FTextField.
final
forceErrorText → String?
An optional property that forces the FormFieldState into an error state by directly setting the FormFieldState.errorText property without running the validator function.
final
formFieldKey → Key?
The key to use for the internal FormField.
final
groupId → Object
The group identifier for the TextFieldTapRegion of this text field.
final
hashCode → int
The hash code for this object.
no setterinherited
hint → String?
The text to display when the text field is empty.
final
ignorePointers → bool?
Determines whether this widget ignores pointer events. Defaults to null, and when null, does nothing.
final
inputFormatters → List<TextInputFormatter>?
Optional input validation and formatting overrides.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType?
The type of keyboard to use for editing the text. Defaults to TextInputType.text if maxLines is one and TextInputType.multiline otherwise.
final
label → Widget?
A builder that creates a widget to display validation errors.
final
magnifierConfiguration → TextMagnifierConfiguration?
The configuration for the magnifier of this text field.
final
maxLength → int?
The maximum number of characters (Unicode grapheme clusters) to allow in the text field.
final
maxLengthEnforcement → MaxLengthEnforcement?
Determines how the maxLength limit should be enforced.
final
maxLines → int?
The maximum number of lines to show at one time, wrapping if necessary.
final
minLines → int?
The minimum number of lines to occupy when the content spans fewer lines.
final
mouseCursor → MouseCursor?
The cursor for a mouse pointer when it enters or is hovering over the widget.
final
obscureText → bool
Whether to hide the text being edited (e.g., for passwords). Defaults to false.
final
obscuringCharacter → String
Character used for obscuring text if obscureText is true.
final
onAppPrivateCommand → AppPrivateCommandCallback?
This is used to receive a private command from the input method.
final
onEditingComplete → VoidCallback?
Called when the user submits editable content (e.g., user presses the "done" button on the keyboard).
final
onReset → VoidCallback?
An optional method to call when the form field is reset via FormFieldState.reset.
final
onSaved → FormFieldSetter<String>?
An optional method to call with the final value when the form is saved via FormState.save.
final
onSubmit → ValueChanged<String>?
Called when the user indicates that they are done editing the text in the field.
final
onTap → VoidCallback?
Called for the first tap in a series of taps.
final
onTapAlwaysCalled → bool
Called for the first tap in a series of taps.
final
onTapOutside → TapRegionCallback?
Whether onTap should be called for every tap.
final
prefixBuilder → Widget Function(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?
The prefix's builder.
final
readOnly → bool
Whether the text can be changed. Defaults to false.
final
restorationId → String?
Restoration ID to save and restore the state of the text field.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollController → ScrollController?
The ScrollController to use when vertically scrolling the input. If null, it will instantiate a new ScrollController.
final
scrollPhysics → ScrollPhysics?
The ScrollPhysics to use when vertically scrolling the input. If not specified, it will behave according to the current platform.
final
selectAllOnFocus → bool?
Whether this field should select all text when gaining focus.
final
selectionControls → TextSelectionControls?
Optional delegate for building the text selection handles.
final
showCursor → bool?
Whether to show cursor.
final
size → FTextFieldSizeVariant
The text field's size variant. Defaults to FTextFieldSizeVariant.md.
final
smartDashesType → SmartDashesType?
Whether to allow the platform to automatically format dashes.
final
smartQuotesType → SmartQuotesType?
Whether to allow the platform to automatically format quotes.
final
spellCheckConfiguration → SpellCheckConfiguration?
Configuration that details how spell check should be performed.
final
statesController → WidgetStatesController?
Represents the interactive "state" of this widget in terms of a set of WidgetStates, including WidgetState.disabled, WidgetState.hovered, WidgetState.error, and WidgetState.focused.
final
style → FTextFieldStyleDelta
The text field's style. Defaults to FThemeData.textFieldStyles.
final
stylusHandwritingEnabled → bool
Whether this input supports stylus handwriting, where the user can write directly on top of a field.
final
suffixBuilder → Widget Function(BuildContext context, FTextFieldStyle style, Set<FTextFieldVariant> variants)?
The suffix's builder.
final
textAlign → TextAlign
How the text should be aligned horizontally.
final
textAlignVertical → TextAlignVertical?
How the text should be aligned vertically.
final
textCapitalization → TextCapitalization
Configures how the platform keyboard will select an uppercase or lowercase keyboard. Defaults to TextCapitalization.none.
final
textDirection → TextDirection?
The directionality of the text. Defaults to the ambient Directionality, if any.
final
textInputAction → TextInputAction?
The type of action button to use for the keyboard.
final
undoController → UndoHistoryController?
Controls the undo state.
final
validator → FormFieldValidator<String>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
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.
override
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, int wrapWidth = 65}) → 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

Static Methods

password({FTextFieldControl control = const .managed(), FObscureTextControl obscureTextControl = const .managed(), FTextFieldSizeVariant size = .md, FTextFieldStyleDelta style = const .context(), FFieldBuilder<FTextFieldStyle> builder = FTextField.defaultBuilder, Widget? label = const LocalizedText.password(), String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction textInputAction = .next, TextCapitalization textCapitalization = .none, TextAlign textAlign = .start, TextAlignVertical? textAlignVertical, TextDirection? textDirection, bool autofocus = false, WidgetStatesController? statesController, String obscuringCharacter = '•', bool autocorrect = false, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = false, int? minLines, int maxLines = 1, bool expands = false, bool readOnly = false, bool? showCursor, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, bool onTapAlwaysCalled = false, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmit, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool enabled = true, bool? ignorePointers, bool enableInteractiveSelection = true, bool? selectAllOnFocus, TextSelectionControls? selectionControls, DragStartBehavior dragStartBehavior = .start, MouseCursor? mouseCursor, FTextFieldCounterBuilder? counterBuilder, ScrollPhysics? scrollPhysics, ScrollController? scrollController, Iterable<String> autofillHints = const [AutofillHints.password], String? restorationId, bool stylusHandwritingEnabled = true, bool enableIMEPersonalizedLearning = true, ContentInsertionConfiguration? contentInsertionConfiguration, EditableTextContextMenuBuilder contextMenuBuilder = FTextField.defaultContextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, FPasswordFieldIconBuilder<FTextFieldStyle>? prefixBuilder, FPasswordFieldIconBuilder<FTextFieldStyle>? suffixBuilder = FTextField.defaultObscureIconBuilder, bool clearable(TextEditingValue) = FTextField.defaultClearable, FFieldClearIconBuilder<FTextFieldStyle> clearIconBuilder = FTextField.defaultClearIconBuilder, FormFieldSetter<String>? onSaved, VoidCallback? onReset, FormFieldValidator<String>? validator, AutovalidateMode autovalidateMode = .disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, Key? formFieldKey, Key? key}) → Widget
Creates a FTextFormField configured for password entry with a visibility toggle.