findComposingRegion static method
Returns the current composing region for the SuperEditor matched by
finder
, or the singular SuperEditor in the widget tree, if finder
is null
.
By default, this method expects a single SuperEditor in the widget tree and
finds it byType
. To specify one SuperEditor among many, pass a superEditorFinder
.
Implementation
static DocumentRange? findComposingRegion([Finder? finder]) {
final element = (finder ?? find.byType(SuperEditor)).evaluate().single as StatefulElement;
final superEditor = element.state as SuperEditorState;
return superEditor.editContext.composer.composingRegion.value;
}