TextEditingValue class final

Immutable editing value shared by single-line and multiline fields.

By default text is canonicalized with sanitizeMultiline. Set preserveText for values whose exact contents matter, such as secrets. Text fields still render control graphemes as safe replacement glyphs; selection and editing continue to address the original text.

Constructors

TextEditingValue({required String text, TextSelection? selection, TextRange composing = TextRange.empty, bool preserveText = false})
TextEditingValue.empty()
factory

Properties

composing → TextRange
final
hashCode → int
The hash code for this object.
no setteroverride
preserveText → bool
Whether edits preserve controls and line endings exactly. This does not enable masking, semantic redaction, or clipboard protection.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selection → TextSelection
final
text → String
The editing text; canonical unless preserveText is true.
final

Methods

copyWith({String? text, TextSelection? selection, TextRange? composing}) → TextEditingValue
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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