CommandPaletteController class final
Shared query, ranking, selection, and viewport controller.
Filtering always goes through matchCommandPaletteItems so static matching, TEA rendering, and widget rendering produce identical order.
Constructors
-
CommandPaletteController({List<
CommandPaletteItem> items = const [], int viewportSize = 7})
Properties
-
filteredItems
→ List<
CommandPaletteItem> -
Enabled items ordered by the shared ranking pipeline.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
CommandPaletteItem> -
no setter
-
matches
→ List<
CommandPaletteMatch> -
Ranked matches for the current query, including scoring evidence.
no setter
- query ↔ String
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedIndex ↔ int
-
getter/setter pair
- selectedItem → CommandPaletteItem?
-
Currently selected filtered item.
no setter
- viewportSize ↔ int
-
Number of result rows a host intends to show.
getter/setter pair
Methods
-
moveSelection(
int delta) → bool -
Moves selection by
delta, wrapping at either end. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
selectIndex(
int index) → bool -
Selects
index, wrapping around the current result list. -
toString(
) → String -
A string representation of this object.
inherited
-
updateItems(
List< CommandPaletteItem> value) → void - Replaces source items and keeps the previously selected identity in view.
-
updateQuery(
String value) → void - Updates the query and selects the highest-ranked result.
-
visibleItems(
{int? viewportSize}) → List< CommandPaletteItem> - Items inside visibleWindow.
-
visibleWindow(
{int? viewportSize}) → CommandPaletteWindow - Visible slice of filteredItems that keeps selectedIndex on screen.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited