TextCompletionController class final
Editing-aware completion state controller.
This owns query/range/options/selection state only. Suggestion providers and popup rendering can be layered above it without changing the text model.
Constructors
Properties
- currentIndex → int?
-
no setter
- currentOption → TextCompletionOption?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether at least one listener is registered.
no setterinherited
- isOpen → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → TextCompletionState
-
no setter
Methods
-
accept(
TextEditingValue value, {bool singleLine = false}) → TextEditingValue? -
Applies the current completion to
valueand closes the controller. -
addListener(
VoidCallback listener) → void -
Registers
listenerto be called when this object changes.inherited -
close(
) → void -
dispose(
) → void -
Marks this notifier as disposed and drops its listeners. Nulls the slots
in place (rather than replacing the backing list) so a dispose called
from within a listener leaves any in-progress notify walk
reading valid, now-empty slots. After disposal, addListener and
notify throw; removeListener remains safe for cleanup.
override
-
focusOption(
int index) → void - Moves the current suggestion without accepting it or taking keyboard focus.
-
listen(
VoidCallback listener) → VoidCallback -
Registers
listenerand returns an idempotent cancellation function.inherited -
moveCurrent(
int delta, {bool wrap = true}) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
Publishes a change to every listener registered when the pass began.
inherited
-
open(
{required TextRange range, String query = '', Iterable< TextCompletionOption> options = const <TextCompletionOption>[], int? currentIndex}) → void -
removeListener(
VoidCallback listener) → void -
Removes a previously-registered listener.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{TextRange? range, String? query, Iterable< TextCompletionOption> ? options}) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited