CarpenterCommandController<I> class
final
Mutable default implementation of CarpenterCommand with observable state.
The controller prevents hidden, disabled, and concurrent invocations, records execution/failure state, and delegates successful work to the supplied callback.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
CarpenterCommandState> - CarpenterCommandController
- Implemented types
- Available extensions
Constructors
-
CarpenterCommandController({required String id, required String title, FutureOr<
CarpenterCommandResult> execute(I input)?, String group = 'General', String? description, List<ShortcutActivator> shortcuts = const [], List<ShortcutActivator> ? macOSShortcuts, List<ShortcutActivator> ? windowsShortcuts, List<ShortcutActivator> ? linuxShortcuts, List<ShortcutActivator> ? iOSShortcuts, List<ShortcutActivator> ? androidShortcuts, List<ShortcutActivator> ? fuchsiaShortcuts, CarpenterCommandPresentation presentation = CarpenterCommandPresentation.automatic, List<CarpenterCommandEffect> effects = const [], CarpenterCommandState initialState = const CarpenterCommandState()}) - Creates a command controller with stable metadata, optional platform shortcuts, semantic effects, and an optional execution callback.
Properties
-
androidShortcuts
→ List<
ShortcutActivator> ? -
Optional Android-specific shortcut override.
final
- description → String?
-
Optional longer description of the command intent.
final
-
effects
→ List<
CarpenterCommandEffect> -
Semantic application effects declared by this command.
final
-
fuchsiaShortcuts
→ List<
ShortcutActivator> ? -
Optional Fuchsia-specific shortcut override.
final
- group → String
-
Logical discovery/organization group; defaults to
General.final - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- id → String
-
Stable semantic identifier for this command.
final
-
iOSShortcuts
→ List<
ShortcutActivator> ? -
Optional iOS-specific shortcut override.
final
-
linuxShortcuts
→ List<
ShortcutActivator> ? -
Optional Linux-specific shortcut override.
final
-
macOSShortcuts
→ List<
ShortcutActivator> ? -
Optional macOS-specific shortcut override.
final
- presentation → CarpenterCommandPresentation
-
Semantic presentation preference used when projecting this command into actions.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shortcuts
→ List<
ShortcutActivator> -
Default shortcut activators.
final
-
state
→ ValueListenable<
CarpenterCommandState> -
This controller itself is the observable command-state listenable.
no setteroverride
- title → String
-
Human-readable action title.
final
- value ↔ CarpenterCommandState
-
The current value stored in this notifier.
getter/setter pairinherited
-
windowsShortcuts
→ List<
ShortcutActivator> ? -
Optional Windows-specific shortcut override.
final
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.
inherited
-
execute(
I input) → Future< CarpenterCommandResult> -
Executes the configured callback for
input.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setAvailability(
{CarpenterCommandVisibility visibility = CarpenterCommandVisibility.visible, required bool enabled, String? disabledReason}) → void - Replaces visibility/enabled state and its optional disabled reason without starting or cancelling execution.
-
shortcutsFor(
TargetPlatform platform) → List< ShortcutActivator> -
Available on CarpenterCommand, provided by the CarpenterCommandPlatformShortcuts extension
Selects the most specific shortcut list forplatform; Apple platforms additionally normalize control modifiers to command/meta semantics. -
toAction(
I input, {String? label, String? semanticLabel, CarpenterIconSource? icon, ActionColorRole? colorRole, ShortcutActivator? shortcut, CarpenterCommandExecutor? executor}) → CarpenterActionDescriptor -
Available on CarpenterCommand<
Creates a presentation-only action snapshot forI> , provided by the CarpenterCommandActionProjection extensioninputfrom the command's current visibility, availability, execution state, shortcuts, and semantic prominence. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited