TextField class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TextField
- Available extensions
Constructors
-
TextField({Key? key, Object? groupId, String? label, Widget? labelWidget, bool appendColonToLabel = true, TextStyle? labelStyle, String? hintText, FocusNode? focusNode, UndoHistoryController? undoController, String? errorText, bool enabled = true, bool readOnly = false, Widget? suffix, Widget? suffixIcon, Widget? prefix, Widget? prefixIcon, bool obscureText = false, String obscuringCharacter = '•', bool? filled, Color? fillColor, BorderRadius? borderRadius, TextEditingController? controller, List<
InputFeedbackText> ? feedback, TextInputType? keyboardType, List<TextInputFormatter> ? inputFormatters, TextCapitalization textCapitalization = material.TextCapitalization.none, TextAlign textAlign = material.TextAlign.start, TextInputAction? textInputAction, StrutStyle? strutStyle, TextDirection? textDirection, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, int? maxLines = 1, int? minLines, bool? expands, TextStyle? textStyle, ValueChanged<String> ? onChanged, VoidCallback? onEditingComplete, ValueChanged<String> ? onSubmitted, AppPrivateCommandCallback? onAppPrivateCommand, InputDecoration? decoration, bool overrideDecoration = false, TextAlignVertical? textAlignVertical, WrapWidgetBuilder? innerBoxWrapper, EdgeInsets scrollPadding = const EdgeInsets.all(10), DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool? autocorrect, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, double? cursorHeight, bool forceErrorStyle = false, bool? showCursor, Iterable<String> ? autofillHints = const [], GestureTapCallback? onTap, bool onTapAlwaysCalled = false, TapRegionCallback? onTapOutside, TapRegionUpCallback? onTapUpOutside, bool autofocus = false, bool canRequestFocus = true, bool enableSuggestions = true, bool enableInteractiveSelection = true, TextSelectionControls? selectionControls, BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight, BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight, Brightness? keyboardAppearance, InputCounterWidgetBuilder? buildCounter, EditableTextContextMenuBuilder? contextMenuBuilder, Clip clipBehavior = material.Clip.hardEdge, Color? cursorColor, Color? cursorErrorColor, double cursorWidth = 2.0, Radius? cursorRadius, bool cursorOpacityAnimates = true, MouseCursor? mouseCursor, ScrollController? scrollController, ScrollPhysics? scrollPhysics, ContentInsertionConfiguration? contentInsertionConfiguration, String? restorationId, bool scribbleEnabled = true, bool? stylusHandwritingEnabled, bool enableIMEPersonalizedLearning = true, SpellCheckConfiguration? spellCheckConfiguration, TextMagnifierConfiguration? magnifierConfiguration, WidgetStatesController? statesController, bool? ignorePointers}) -
const
-
TextField.borderless({Key? key, String? label, Widget? labelWidget, bool appendColonToLabel = true, TextStyle? labelStyle, String? hintText, FocusNode? focusNode, String? errorText, bool enabled = true, bool readOnly = false, Widget? suffix, Widget? suffixIcon, Widget? prefix, Widget? prefixIcon, bool obscureText = false, Color? fillColor, TextEditingController? controller, List<
InputFeedbackText> ? feedback, TextInputType? keyboardType, List<TextInputFormatter> ? inputFormatters, TextCapitalization textCapitalization = material.TextCapitalization.none, TextAlign textAlign = material.TextAlign.start, TextInputAction? textInputAction, int? maxLength, int? maxLines = 1, int? minLines, bool? expands, TextStyle? textStyle, ValueChanged<String> ? onChanged, ValueChanged<String> ? onSubmitted, TextAlignVertical? textAlignVertical, WrapWidgetBuilder? innerBoxWrapper, bool forceErrorStyle = false, bool autofocus = false, bool enableSuggestions = true, Iterable<String> ? autofillHints}) -
Convenient factory creating a borderless TextField (ideal for search bars & inline edits).
factory
-
TextField.filled({Key? key, String? label, Widget? labelWidget, bool appendColonToLabel = true, TextStyle? labelStyle, String? hintText, FocusNode? focusNode, String? errorText, bool enabled = true, bool readOnly = false, Widget? suffix, Widget? suffixIcon, Widget? prefix, Widget? prefixIcon, bool obscureText = false, Color? fillColor, BorderRadius? borderRadius, TextEditingController? controller, List<
InputFeedbackText> ? feedback, TextInputType? keyboardType, List<TextInputFormatter> ? inputFormatters, TextCapitalization textCapitalization = material.TextCapitalization.none, TextAlign textAlign = material.TextAlign.start, TextInputAction? textInputAction, int? maxLength, int? maxLines = 1, int? minLines, bool? expands, TextStyle? textStyle, ValueChanged<String> ? onChanged, ValueChanged<String> ? onSubmitted, InputDecoration? decoration, bool overrideDecoration = false, TextAlignVertical? textAlignVertical, WrapWidgetBuilder? innerBoxWrapper, bool forceErrorStyle = false, bool autofocus = false, bool enableSuggestions = true, Iterable<String> ? autofillHints}) -
Convenient factory creating a filled TextField.
factory
-
TextField.outlined({Key? key, String? label, Widget? labelWidget, bool appendColonToLabel = true, TextStyle? labelStyle, String? hintText, FocusNode? focusNode, String? errorText, bool enabled = true, bool readOnly = false, Widget? suffix, Widget? suffixIcon, Widget? prefix, Widget? prefixIcon, bool obscureText = false, BorderRadius? borderRadius, TextEditingController? controller, List<
InputFeedbackText> ? feedback, TextInputType? keyboardType, List<TextInputFormatter> ? inputFormatters, TextCapitalization textCapitalization = material.TextCapitalization.none, TextAlign textAlign = material.TextAlign.start, TextInputAction? textInputAction, int? maxLength, int? maxLines = 1, int? minLines, bool? expands, TextStyle? textStyle, ValueChanged<String> ? onChanged, ValueChanged<String> ? onSubmitted, InputDecoration? decoration, bool overrideDecoration = false, TextAlignVertical? textAlignVertical, WrapWidgetBuilder? innerBoxWrapper, bool forceErrorStyle = false, bool autofocus = false, bool enableSuggestions = true, Iterable<String> ? autofillHints}) -
Convenient factory creating an outlined TextField.
factory
Properties
- appendColonToLabel → bool
-
Controls whether a colon
:is appended automatically to the label text.final - autocorrect → bool?
-
final
-
autofillHints
→ Iterable<
String> ? -
final
- autofocus → bool
-
final
- borderRadius → BorderRadius?
-
final
- buildCounter → InputCounterWidgetBuilder?
-
final
- canRequestFocus → bool
-
final
- clipBehavior → Clip
-
final
- contentInsertionConfiguration → ContentInsertionConfiguration?
-
final
- contextMenuBuilder → EditableTextContextMenuBuilder?
-
final
- controller → TextEditingController?
-
final
- cursorColor → Color?
-
final
- cursorErrorColor → Color?
-
final
- cursorHeight → double?
-
final
- cursorOpacityAnimates → bool
-
final
- cursorRadius → Radius?
-
final
- cursorWidth → double
-
final
- decoration → InputDecoration?
-
final
- dragStartBehavior → DragStartBehavior
-
final
- enabled → bool
-
final
- enableIMEPersonalizedLearning → bool
-
final
- enableInteractiveSelection → bool
-
final
- enableSuggestions → bool
-
final
- errorText → String?
-
final
- expands → bool?
-
final
-
feedback
→ List<
InputFeedbackText> ? -
Checklist feedback items displayed below the input
final
- fillColor → Color?
-
Direct fill color override for the input container
final
- filled → bool?
-
final
- focusNode → FocusNode?
-
final
- forceErrorStyle → bool
-
Provides a way to force error style (normally red colored)
final
- groupId → Object?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hintText → String?
-
final
- ignorePointers → bool?
-
final
- innerBoxWrapper → WrapWidgetBuilder?
-
Defines a custom builder widget that will wrap the TextField inner box
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardAppearance → Brightness?
-
final
- keyboardType → TextInputType?
-
final
- label → String?
-
final
- labelStyle → TextStyle?
-
Define a custom style to be used in the label of the field
final
- labelWidget → Widget?
-
Allows providing a fully custom label widget.
When labelWidget is not null it will be used instead of the
labeltext.final - magnifierConfiguration → TextMagnifierConfiguration?
-
final
- maxLength → int?
-
final
- maxLengthEnforcement → MaxLengthEnforcement?
-
final
- maxLines → int?
-
final
- minLines → int?
-
final
- mouseCursor → MouseCursor?
-
final
- obscureText → bool
-
final
- obscuringCharacter → String
-
final
- onAppPrivateCommand → AppPrivateCommandCallback?
-
final
-
onChanged
→ ValueChanged<
String> ? -
final
- onEditingComplete → VoidCallback?
-
final
-
onSubmitted
→ ValueChanged<
String> ? -
final
- onTap → VoidCallback?
-
final
- onTapAlwaysCalled → bool
-
final
- onTapOutside → TapRegionCallback?
-
final
- onTapUpOutside → TapRegionUpCallback?
-
final
- overrideDecoration → bool
-
Provides a way to override default input decoration styles.
If set to
true, the provided decoration is used as-is without merging defaults.final - prefix → Widget?
-
final
- prefixIcon → Widget?
-
final
- readOnly → bool
-
final
- restorationId → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scribbleEnabled → bool
-
final
- scrollController → ScrollController?
-
final
- scrollPadding → EdgeInsets
-
final
- scrollPhysics → ScrollPhysics?
-
final
- selectionControls → TextSelectionControls?
-
final
- selectionHeightStyle → BoxHeightStyle
-
final
- selectionWidthStyle → BoxWidthStyle
-
final
- showCursor → bool?
-
final
- smartDashesType → SmartDashesType?
-
final
- smartQuotesType → SmartQuotesType?
-
final
- spellCheckConfiguration → SpellCheckConfiguration?
-
final
- statesController → WidgetStatesController?
-
final
- strutStyle → StrutStyle?
-
final
- stylusHandwritingEnabled → bool?
-
final
- suffix → Widget?
-
final
- suffixIcon → Widget?
-
final
- textAlign → TextAlign
-
final
- textAlignVertical → TextAlignVertical?
-
final
- textCapitalization → TextCapitalization
-
final
- textDirection → TextDirection?
-
final
- textInputAction → TextInputAction?
-
final
- textStyle → TextStyle?
-
final
- undoController → UndoHistoryController?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _TextFieldState -
Creates the mutable state for this widget at a given location in the tree.
override
-
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, 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
-
withGBInputWrapper(
{String? label, Widget? labelWidget, bool appendColonToLabel = true, TextStyle? labelStyle, String? errorText, bool hasError = false, List< InputFeedbackText> ? feedback, WrapWidgetBuilder? innerBoxWrapper, BoxConstraints? constraints}) → Widget -
Available on Widget, provided by the GBInputWrapperExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- baseBorderSide → const BorderSide
- baseOutlineBorder → const OutlineInputBorder
- noBorderSide → const BorderSide