TextField class

Inheritance

Constructors

TextField({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, bool? filled, 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, void onChanged(String value)?, InputDecoration? decoration, bool overrideDecoration = false, TextAlignVertical? textAlignVertical, WrapWidgetBuilder? innerBoxWrapper, ValueChanged<String>? onSubmitted, EdgeInsets scrollPadding = const EdgeInsets.all(10), bool? autocorrect, double? cursorHeight, bool forceErrorStyle = false, bool? showCursor, Iterable<String>? autofillHints = const [], TapRegionCallback? onTapOutside, TapRegionUpCallback? onTapUpOutside, VoidCallback? onTap, bool autofocus = false, bool canRequestFocus = true, bool enableSuggestions = true, InputCounterWidgetBuilder? buildCounter, EditableTextContextMenuBuilder? contextMenuBuilder, Clip clipBehavior = material.Clip.hardEdge, Color? cursorColor, double cursorWidth = 2.0, Radius? cursorRadius, bool cursorOpacityAnimates = true, MouseCursor? mouseCursor, SpellCheckConfiguration? spellCheckConfiguration})
const

Properties

appendColonToLabel → bool
Controls whether a colon : is appended automatically to the label text.
final
autocorrect → bool?
Whether to enable autocorrection.
final
autofillHints → Iterable<String>?
A list of strings that helps the autofill service identify the type of this text input.
final
autofocus → bool
final
borderRadius → BorderRadius?
final
buildCounter → InputCounterWidgetBuilder?
final
canRequestFocus → bool
final
clipBehavior → Clip
final
contextMenuBuilder → EditableTextContextMenuBuilder?
final
controller → TextEditingController?
final
cursorColor → Color?
final
cursorHeight → double?
Provides a way to modify the input cursorHeight
final
cursorOpacityAnimates → bool
Whether the cursor will animate from fully transparent to fully opaque during each cursor blink.
final
cursorRadius → Radius?
How rounded the corners of the cursor should be.
final
cursorWidth → double
How thick the cursor will be.
final
decoration → InputDecoration?
Provides a way to override default input decoration styles by default if you only provide this value it will merge your style definition with default if you want to relay completely on your styling set overrideDecoration to true
final
enabled → bool
final
enableSuggestions → bool
final
errorText → String?
final
expands → bool?
final
feedback → List<InputFeedbackText>?
final
filled → bool?
final
focusNode → FocusNode?
final
forceErrorStyle → bool
Provides a way to force error style (normally red colored)
final
hashCode → int
The hash code for this object.
no setterinherited
hintText → String?
final
innerBoxWrapper → WrapWidgetBuilder?
Defines a custom builder widget that will wrap the TexField inner box This is useful to for example wrap your widget inside a Material elevation, etc
final
inputFormatters → List<TextInputFormatter>?
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
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 label text.
final
maxLength → int?
final
maxLines → int?
final
minLines → int?
final
mouseCursor → MouseCursor?
final
obscureText → bool
final
onChanged → void Function(String value)?
final
onSubmitted → void Function(String value)?
Called when the user indicates that they are done editing the text in the field.
final
onTap → VoidCallback?
final
onTapOutside → TapRegionCallback?
Called for each tap down that occurs outside of the TextFieldTapRegion group when the text field is focused.
final
onTapUpOutside → TapRegionUpCallback?
Called for each tap up that occurs outside of the TextFieldTapRegion group when the text field is focused.
final
overrideDecoration → bool
Check decoration property for more info defaults to false
final
prefix → Widget?
final
prefixIcon → Widget?
final
readOnly → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollPadding → EdgeInsets
Configures the padding for the edges surrounding a Scrollable when the text field scrolls into view.
final
showCursor → bool?
Controls whether the cursor is visible when the field is not focused
final
spellCheckConfiguration → SpellCheckConfiguration?
final
suffix → Widget?
final
suffixIcon → Widget?
final
textAlign → TextAlign
final
textAlignVertical → TextAlignVertical?
TextAlign
final
textCapitalization → TextCapitalization
final
textInputAction → TextInputAction?
final
textStyle → TextStyle?
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

Operators

operator ==(Object other) → bool
The equality operator.
inherited