TextEdits class abstract final

The edits a rich text composer makes at a text field's cursor: the operations of an EditTextAction, list continuation on Enter, and what the field's triggers read about the cursor.

Each edit takes the field's current value and returns the new one, with the cursor (or selection) where typing would leave it. An invalid selection counts as a cursor at the end of the text.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Methods

apply(TextEditingValue value, EditTextOperation operation, {String text = '', String before = '', String? after, bool numbered = false}) → TextEditingValue?
Applies operation with the given inputs (variables already substituted) to value. Null for EditTextOperation.focus, which doesn't change the text.
continueList(TextEditingValue value) → TextEditingValue?
Enter inside a list item: continues the list on a new line (- or the next number), or, on an empty item, ends it by removing the marker. Null when the cursor isn't at a list item, or text is selected.
insert(TextEditingValue value, String insert) → TextEditingValue
Inserts insert in place of the selection, with a space before it when the character before isn't whitespace (so a Mention button's @ starts a new word).
replaceWord(TextEditingValue value, String replacement) → TextEditingValue
Replaces the word ending at the cursor (see wordStart), and the selection if any, with replacement: the @ma being typed becomes the picked @maya .
resultOf(TextEditingValue value) → Map<String, Object>
What a text field's triggers read in ${result} about value:
selectionOf(TextEditingValue value) → TextSelection
value's selection, or a cursor at the end when it has none.
setText(String text) → TextEditingValue
text in place of everything, cursor at its end.
toggleList(TextEditingValue value, {bool numbered = false}) → TextEditingValue
Turns the lines the selection touches into - items, or 1. , 2. ones when numbered, or back into plain lines when they all are such items already. The cursor goes to the end of the lines.
wordStart(String text, int offset) → int
Where the word ending at offset in text starts: the run of non-whitespace characters before it.
wrap(TextEditingValue value, String before, String after) → TextEditingValue
Wraps the selection in before and after, keeping the wrapped text selected, or inserts the empty pair with the cursor between.