TextArea class

A multiline text area input field for the Alter Design System built on TextInput.

Features:

  • Configurable lines (default: 4) which reserves multiline visual space.
  • Character limit counting and validation.
  • Reuses TextInput and InputControl for full design system tokens, states, and error handling.
Inheritance

Constructors

TextArea({Key? key, String? label = 'Description', bool isRequired = false, int? characterLimit = 200, InputControlType type = InputControlType.gray, int lines = 4, int? minLines, IconData? leftIcon, Widget? leftIconWidget, String? prefix, Widget? prefixWidget, String placeholder = 'Enter description...', String? value, TextEditingController? controller, FocusNode? focusNode, String? suffix, Widget? suffixWidget, ButtonIconGhost? rightButton, bool isError = false, bool showErrorMessage = true, String errorMessage = 'Error Message', List<String>? errorMessages, Widget? errorIconWidget, FormFieldValidator<String>? validator, FormFieldSetter<String>? onSaved, AutovalidateMode? autovalidateMode, bool enabled = true, bool readOnly = false, bool autofocus = false, TextInputType? keyboardType, List<TextInputFormatter>? inputFormatters, ValueChanged<String>? onChanged, ValueChanged<String>? onSubmitted, VoidCallback? onTap})
Creates a TextArea multiline input instance.
const

Properties

autofocus → bool
Whether the text area autofocuses.
final
autovalidateMode → AutovalidateMode?
Autovalidate mode for form integration.
final
characterLimit → int?
Maximum allowed character limit counter displayed on typing.
final
controller → TextEditingController?
External text editing controller.
final
enabled → bool
Whether the text area is interactive.
final
errorIconWidget → Widget?
Custom icon widget override for the error message banner.
final
errorMessage → String
Default error message text.
final
errorMessages → List<String>?
Optional list of multiple error messages.
final
focusNode → FocusNode?
Focus node controlling input focus.
final
hashCode → int
The hash code for this object.
no setterinherited
inputFormatters → List<TextInputFormatter>?
Formatters applied to the text field input.
final
isError → bool
Whether the input is in an explicit error state.
final
isRequired → bool
Whether to display a red required asterisk next to the label.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType?
Virtual keyboard type for software keyboards.
final
label → String?
Label text displayed above the text area.
final
leftIcon → IconData?
Leading icon data.
final
leftIconWidget → Widget?
Custom leading widget override.
final
lines → int
Number of text lines determining the height of the area.
final
minLines → int?
Optional minimum number of lines for dynamic expansion.
final
onChanged → ValueChanged<String>?
Callback executed on value changes.
final
onSaved → FormFieldSetter<String>?
Form field on-saved callback.
final
onSubmitted → ValueChanged<String>?
Callback executed on keyboard submit.
final
onTap → VoidCallback?
Callback executed when the input container is tapped.
final
placeholder → String
Hint placeholder text.
final
prefix → String?
Prefix text displayed before the input value.
final
prefixWidget → Widget?
Custom prefix widget override.
final
readOnly → bool
Whether the text area is read-only.
final
rightButton → ButtonIconGhost?
Trailing action button (e.g. ButtonIconGhost).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showErrorMessage → bool
Whether to render the error message beneath the field.
final
suffix → String?
Suffix descriptor text displayed at the trailing end.
final
suffixWidget → Widget?
Custom suffix widget override.
final
type → InputControlType
Surface background and border style variant.
final
validator → FormFieldValidator<String>?
Form field validation callback.
final
value → String?
Initial or bound value string.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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

Constants

version → const String
Component version for reference. v2.4.0: Added optional keyboardType (TextInputType?) fallback passthrough. v2.3.0: Streamlined multiline sizing: Clean minLines and lines (max height) configuration. Non-adaptive fixed height when minLines is null; adaptive auto-expanding height up to lines when minLines is provided. v2.1.0: Aligned with InputControl v2.1.0 & TextInput v2.1.0 (removed showLabel/showCharacterLimit; labelBar renders when label is provided). v2.0.0: Aligned with InputControl v2.0.0 & TextInput v2.0.0 (removed statusOverride and redundant hasX booleans in favor of clean nullable props). v1.0.0: Initial release of TextArea wrapper built on TextInput with configurable lines height.