TextEditingValue class Null safety
The current text, selection, and composing state for editing a run of text.
- Annotations
Constructors
- TextEditingValue({String text = '', TextSelection selection = const TextSelection.collapsed(offset: -1), TextRange composing = TextRange.empty})
-
Creates information for editing a run of text.
const
-
TextEditingValue.fromJSON(Map<
String, dynamic> encoded) -
Creates an instance of this class from a JSON object.
factory
Properties
- composing → TextRange
-
The range of text that is still being composed.
final
- hashCode → int
-
The hash code for this object.
read-onlyoverride
- isComposingRangeValid → bool
-
Whether the composing range is a valid range within text.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- selection → TextSelection
-
The range of text that is currently selected.
final
- text → String
-
The current text being edited.
final
Methods
-
copyWith(
{String? text, TextSelection? selection, TextRange? composing}) → TextEditingValue - Creates a copy of this value but with the given fields replaced with the new values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
replaced(
TextRange replacementRange, String replacementString) → TextEditingValue -
Returns a new TextEditingValue, which is this TextEditingValue with
its text partially replaced by the
replacementString
. -
toJSON(
) → Map< String, dynamic> - Returns a representation of this object as a JSON object.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- empty → const TextEditingValue
- A value that corresponds to the empty string with no selection and no composing range.