EditorState class

The immutable state of the code editor.

Holds the current doc, selection, resolved facet values, and state-field values. New states are produced by calling update to create a Transaction and then accessing transaction.state.

Constructors

EditorState.create({Document? doc, String? docString, EditorSelection? selection, List<Extension> extensions = const []})
Create a new editor state from scratch.
factory

Properties

doc → Document
The current document.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selection → EditorSelection
The current selection.
final

Methods

applyTransaction(Transaction tr) EditorState
Apply a transaction and return the new state (convenience).
facet<Input, Output>(Facet<Input, Output> f) → Output
Read a resolved facet value.
field<T>(StateField<T> f) → T
Read a state field value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(TransactionSpec spec) → Transaction
Create a Transaction from a TransactionSpec.

Operators

operator ==(Object other) bool
The equality operator.
inherited