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:
- https://forui.dev/docs/form/text-form-field for working examples.
- FTextFieldStyle for customizing a text field's appearance.
- FTextField for creating a text field that can be used in a form.
- TextField for more details about working with a text field.
- Inheritance
- 
    - Object
- DiagnosticableTree
- Widget
- StatelessWidget
- FTextFormField
 
- Mixed-in types
Constructors
- 
          FTextFormField({FTextFieldStyle style(FTextFieldStyle style)?, Widget builder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states, Widget field) = Defaults.builder, Widget? label, String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, TextEditingController? controller, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.none, TextAlign 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, ValueChanged<String> ? onChange, 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 = 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 = Defaults.contextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, Widget prefixBuilder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states)?, Widget suffixBuilder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states)?, bool clearable(TextEditingValue) = Defaults.clearable, FormFieldSetter<String> ? onSaved, VoidCallback? onReset, FormFieldValidator<String> ? validator, String? initialText, AutovalidateMode autovalidateMode = AutovalidateMode.disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = _errorBuilder, Key? key})
- 
          Creates a FTextFormField.
            const
- 
          FTextFormField.email({FTextFieldStyle style(FTextFieldStyle style)?, Widget builder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states, Widget field) = Defaults.builder, Widget? label = const LocalizedText.email(), String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, TextEditingController? controller, FocusNode? focusNode, TextInputType? keyboardType = TextInputType.emailAddress, TextInputAction? textInputAction = TextInputAction.next, TextCapitalization textCapitalization = TextCapitalization.none, TextAlign 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, ValueChanged<String> ? onChange, 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 = 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 = Defaults.contextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, Widget prefixBuilder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states)?, Widget suffixBuilder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states)?, bool clearable(TextEditingValue) = Defaults.clearable, FormFieldSetter<String> ? onSaved, VoidCallback? onReset, FormFieldValidator<String> ? validator, String? initialText, AutovalidateMode autovalidateMode = AutovalidateMode.disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = _errorBuilder, Key? key})
- 
          Creates a FTextFormField configured for emails.
            const
- 
          FTextFormField.multiline({FTextFieldStyle style(FTextFieldStyle style)?, Widget builder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states, Widget field) = Defaults.builder, Widget? label, String? hint, Widget? description, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, TextEditingController? controller, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.sentences, TextAlign 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, ValueChanged<String> ? onChange, 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 = 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 = Defaults.contextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, Widget prefixBuilder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states)?, Widget suffixBuilder(BuildContext context, FTextFieldStyle style, Set<WidgetState> states)?, bool clearable(TextEditingValue) = Defaults.clearable, FormFieldSetter<String> ? onSaved, VoidCallback? onReset, FormFieldValidator<String> ? validator, String? initialText, AutovalidateMode autovalidateMode = AutovalidateMode.disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = _errorBuilder, 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<WidgetState> states, 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
- 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
- controller → TextEditingController?
- 
  Controls the text being edited. If null, this widget will create its own TextEditingController.
  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
- 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
- initialText → String?
- 
  The initial text.
  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
- 
  onChange
  → ValueChanged<String> ?
- 
  Called when the user initiates a change to the TextField's value: when they have inserted or deleted text.
  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 → GestureTapCallback?
- 
  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<WidgetState> states)?
- 
  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
- 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 → FTextFieldStyle Function(FTextFieldStyle style)?
- 
  The text field's style. Defaults to FThemeData.textFieldStyle.
  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<WidgetState> states)?
- 
  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({FTextFieldStyle style(FTextFieldStyle style)?, FFieldBuilder< FTextFieldStyle> builder = Defaults.builder, Widget? label = const LocalizedText.password(), String? hint, Widget? description, Widget? error, TextMagnifierConfiguration? magnifierConfiguration, Object groupId = EditableText, TextEditingController? controller, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction textInputAction = TextInputAction.next, TextCapitalization textCapitalization = TextCapitalization.none, TextAlign 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, ValueChanged<String> ? onChange, 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 = 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 = Defaults.contextMenuBuilder, bool canRequestFocus = true, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, FPasswordFieldIconBuilder<FTextFieldStyle> ? prefixBuilder, FPasswordFieldIconBuilder<FTextFieldStyle> ? suffixBuilder = PasswordField.defaultToggleBuilder, bool clearable(TextEditingValue) = Defaults.clearable, ValueNotifier<bool> ? obscureTextController, FormFieldSetter<String> ? onSaved, VoidCallback? onReset, FormFieldValidator<String> ? validator, String? initialText, AutovalidateMode autovalidateMode = AutovalidateMode.disabled, String? forceErrorText, Widget errorBuilder(BuildContext context, String message) = _errorBuilder, Key? key}) → Widget
- Creates a FTextFormField configured for password entry with a visibility toggle.