TextField class

Inheritance

Constructors

TextField({Key? key, String? label, 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, double maxWidth = 343, TextAlignVertical? textAlignVertical, WrapWidgetBuilder? innerBoxWrapper, ValueChanged<String>? onSubmitted, EdgeInsets scrollPadding = const EdgeInsets.all(10), bool? autocorrect, double? cursorHeight, bool forceErrorStyle = false, Iterable<String>? autofillHints = const []})
const

Properties

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
borderRadius BorderRadius?
final
controller TextEditingController?
final
cursorHeight double?
Provides a way to modify the input cursorHeight
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
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
maxLength int?
final
maxLines int?
final
maxWidth double
Define max width constraints for this field by default is 343
final
minLines int?
final
obscureText bool
final
onChanged → void Function(String value)?
final
onSubmitted ValueChanged<String>?
Called when the user indicates that they are done editing the text in the field.
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 padding to edges surrounding a Scrollable when the Textfield scrolls into view.
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}) 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