ZefyrScope class

Provides access to shared state of ZefyrEditor or ZefyrView.

A scope object can be created by an editable widget like ZefyrEditor in which case it provides access to editing state, including focus nodes, selection and such. Editable scope can be created using ZefyrScope.editable constructor.

If a scope object is created by a view-only widget like ZefyrView then it only provides access to imageDelegate.

Can be retrieved using ZefyrScope.of.

Inheritance

Constructors

ZefyrScope.editable({@required ZefyrMode mode, @required ZefyrController controller, @required FocusNode focusNode, @required FocusScopeNode focusScope, ZefyrImageDelegate imageDelegate})
Creates editable scope. [...]
ZefyrScope.view({ZefyrImageDelegate imageDelegate})
Creates a view-only scope. [...]

Properties

controller ZefyrController
read / write
cursorTimer → CursorTimer
read-only
focusNode FocusNode
read / write
focusOwner FocusOwner
read-only
focusScope FocusScopeNode
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
imageDelegate ZefyrImageDelegate
read / write
isEditable bool
Whether this scope is backed by editable Zefyr widgets or read-only view. [...]
final
mode ZefyrMode
read / write
renderContext → ZefyrRenderContext
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
selection TextSelection
read-only
selectionStyle NotusStyle
read-only
showCursor ValueNotifier<bool>
read-only
toolbarFocusNode FocusNode
write-only

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes. [...]
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener and removeListener will throw after the object is disposed). [...]
override
focus() → void
formatSelection(NotusAttribute value) → void
hideKeyboard() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited
toString() String
A string representation of this object. [...]
override
updateSelection(TextSelection value, {ChangeSource source = ChangeSource.remote}) → void

Operators

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

Static Methods

of(BuildContext context) ZefyrScope