MinimalCommandItem class
One action a MinimalCommand offers: its label, an optional glyph, the group it is listed under, its keyboard shortcut printed as key caps, and the extra keywords a search should also match.
onSelected runs when the action is chosen; an action without one is listed but disabled.
MinimalCommandItem('New habit', icon: LucideIcons.plus, group: 'Habits', shortcut: 'N', onSelected: create)
- Annotations
Constructors
-
MinimalCommandItem(String label, {IconData? icon, String? group, String? detail, String? shortcut, List<
String> keywords = const <String>[], VoidCallback? onSelected}) -
A command saying
label.const
Properties
- detail → String?
-
A quiet second word after the label (
HAB-4,Morning).final - enabled → bool
-
Whether it can run: it has an onSelected.
no setter
- group → String?
-
The heading the action is listed under; actions keep the order their
groups first appear in.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
A glyph before the label.
final
-
keywords
→ List<
String> -
More words a search matches the action by.
final
- label → String
-
What the command says, and what a query matches first.
final
- onSelected → VoidCallback?
-
What choosing the action does; null lists it disabled.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shortcut → String?
-
The action's shortcut as a chord of space-separated keys (
'⌘ K','G T'), printed as caps by MinimalKbd.chord — the same shape a MinimalMenuItem and a MinimalSearchField take.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited