TextFormField class

A convenience widget that combines a TextField with form field validation.

Integrates with the parent Form for validation and saving of text input.

Inheritance

Constructors

TextFormField({Key? key, TextEditingController? controller, String? initialValue, String? validator(String?)?, void onSaved(String)?, String? placeholder, TextStyle? style, int? maxLength})
Creates a TextFormField with optional controller and validator.
const

Properties

controller TextEditingController?
An optional external text controller.
final
hashCode int
The hash code for this object.
no setterinherited
initialValue String?
The initial text value when no controller is provided.
final
key Key?
Controls how one widget replaces another in the tree.
finalinherited
maxLength int?
The maximum number of characters allowed.
final
onSaved → void Function(String)?
Called when the parent Form is saved with the current text.
final
placeholder String?
Placeholder text displayed when the field is empty.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style TextStyle?
The text style applied to the input.
final
validator String? Function(String?)?
An optional validation function for the text content.
final

Methods

createElement() StatefulElement
Creates the Element for this widget.
inherited
createState() State<TextFormField>
Creates the mutable state for this widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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