The current text, selection, and composing state for editing a run of text.

Constructors

TextEditingState({String text, int selectionBase: -1, int selectionExtent: -1, TextAffinity selectionAffinity: TextAffinity.downstream, bool selectionIsDirectional: false, int composingBase: -1, int composingExtent: -1 })

Creates state for text editing.

const
TextEditingState.fromJSON(Map<String, dynamic> encoded)

Creates an instance of this class from a JSON object.

factory

Properties

composingBase → int

The offset in text at which the composing region originates.

read-only
composingExtent → int

The offset in text at which the selection terminates.

read-only
selectionAffinity → TextAffinity

If the the text range is collapsed and has more than one visual location (e.g., occurs at a line break), which of the two locations to use when painting the caret.

read-only
selectionBase → int

The offset in text at which the selection originates.

read-only
selectionExtent → int

The offset in text at which the selection terminates.

read-only
selectionIsDirectional → bool

Whether this selection has disambiguated its base and extent.

read-only
text → String

The text that is currently being edited.

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

toJSON() → Map<String, dynamic>

Returns a representation of this object as a JSON object.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.

inherited