TextAreaFormField class

A form field wrapping a multi-line text editing area.

Handles text wrapping, multiple lines (using Enter key insertions), vertical scroll offsets when cursor extends past the height constraint, and undo/redo history stacks.

Example

TextAreaFormField(
  label: 'Description',
  description: 'Enter your bio',
  fieldHeight: 5,
)
Inheritance

Constructors

TextAreaFormField({required String label, String description = '', String? initialValue, String? validator(String?)?, bool focused = false, int fieldHeight = 3, Style style = Style.empty, Style cursorStyle = const Style(modifiers: Modifier.underline), String placeholder = '', Style placeholderStyle = const Style(foreground: Color(128, 128, 128))})
Creates a TextAreaFormField for multi-line text editing.

Properties

cursorColumn → int
The cursor column in the text area.
no setter
cursorLine → int
The cursor line in the text area.
no setter
description → String
Optional secondary description text for helper information.
finalinherited
errorText ↔ String?
The validation error text if validation fails; otherwise, null.
getter/setter pairinherited
fieldHeight → int
The fixed height of the text area.
final
focused ↔ bool
Whether this field currently has input focus.
getter/setter pairinherited
hasError → bool
Returns whether this field currently contains a validation error.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
initialValue → String?
The initial value of the field when created or reset.
finalinherited
key → Key?
The optional key for this widget.
finalinherited
label → String
The title label displayed for this field.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
touched ↔ bool
Whether this field has been focused at least once.
getter/setter pairinherited
validator → String? Function(String?)?
A validation function called by FormState.validate. Returns an error message string if invalid, or null if valid.
finalinherited
value ↔ String?
The current value of the form field.
getter/setter pairinherited

Methods

createElement() → Element
Creates an Element to manage this widget's location in the tree.
inherited
createState() → State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
getIntrinsicHeight(int width) → int
Computes the intrinsic height of this widget under the given width constraint.
inherited
getIntrinsicWidth(int height) → int
Computes the intrinsic width of this widget under the given height constraint.
inherited
getPreferredHeight() → int
Calculates preferred layout height needed to render this field cleanly.
override
handleKeyEvent(KeyEvent event) → bool
Handles user key inputs to update the internal value.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validate() → bool
Runs the validator callback against the current field value. Updates errorText and returns whether the field is valid.
inherited

Operators

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