CarpenterCommandState class final

Immutable observable availability and execution state for a command.

Visibility, enabled state, execution phase, and the latest error are kept separate so presentation surfaces can distinguish unavailable, hidden, running, and failed commands without inferring state from callbacks.

Annotations

Constructors

CarpenterCommandState({CarpenterCommandVisibility visibility = CarpenterCommandVisibility.visible, bool enabled = true, String? disabledReason, CarpenterCommandExecution execution = CarpenterCommandExecution.idle, Object? error})
Creates command state with visible, enabled, idle defaults.
const

Properties

disabledReason String?
Optional user-facing reason explaining why an unavailable command is disabled.
final
enabled bool
Whether the command may currently be invoked.
final
error Object?
Error retained from the latest failed invocation, otherwise null.
final
execution CarpenterCommandExecution
Current execution phase for the command.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
visibility CarpenterCommandVisibility
Whether the command is visible to presentation surfaces.
final

Methods

copyWith({CarpenterCommandVisibility? visibility, bool? enabled, String? disabledReason, CarpenterCommandExecution? execution, Object? error, bool clearDisabledReason = false, bool clearError = false}) CarpenterCommandState
Returns a state copy, preserving nullable values unless their corresponding clear flag is set.
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