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.

Properties

builder Widget Function(FormFieldState<String>)
Builds the visual representation using the current field state.
finalinherited
controller TextEditingController?
An optional external text controller.
final
hashCode int
The hash code for this object.
no setterinherited
initialValue String
The starting value of the field.
finalinherited
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.
finalinherited
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 that returns an error string or null.
finalinherited

Methods

createElement() StatefulElement
Creates the Element for this widget.
inherited
createState() State<FormField<String>>
Creates the mutable state for this widget.
inherited
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