UiConfirmActionGroup class

Two-button confirmation group with coordinated width and label morphs.

The primary action first enters a confirmation state. In that state the primary button expands and changes to confirmLabel, while the secondary button shrinks and becomes cancelLabel.

Inheritance

Constructors

UiConfirmActionGroup({Key? key, required String actionLabel, required VoidCallback onConfirm, String confirmLabel = 'Are you sure?', String cancelLabel = 'Cancel', String? secondaryLabel, VoidCallback? onCancel, VoidCallback? onSecondaryPressed, bool? confirming, bool initiallyConfirming = false, ValueChanged<bool>? onConfirmingChanged, Object? resetKey, UiIntent actionIntent = UiIntent.destructive, UiIntent? confirmIntent, UiIntent secondaryIntent = UiIntent.neutral, UiIntent cancelIntent = UiIntent.neutral, Widget? actionLeading, Widget? confirmLeading, Widget? secondaryLeading, Widget? cancelLeading, bool isProcessing = false, bool actionDisabled = false, bool secondaryDisabled = false, bool actionShowBorder = true, bool secondaryShowBorder = true, UiSize size = UiSize.sm, int primaryFlex = 1, int confirmingPrimaryFlex = 2, int secondaryFlex = 2, int confirmingSecondaryFlex = 1, double compactBreakpoint = 420, double? spacing, UiMotionDuration duration = UiMotionDuration.slow, Curve? curve, String? semanticLabel})
const

Properties

actionDisabled bool
Whether the primary action is disabled before confirmation.
final
actionIntent UiIntent
Primary intent before confirmation.
final
actionLabel String
Initial primary label, for example "Save" or "Delete".
final
actionLeading Widget?
Optional primary leading widget before confirmation.
final
actionShowBorder bool
Whether to paint the primary button outline when its style resolves one.
final
cancelIntent UiIntent
Secondary intent during confirmation.
final
cancelLabel String
Secondary label once confirmation is active.
final
cancelLeading Widget?
Optional secondary leading widget during confirmation.
final
compactBreakpoint double
Below this width the group falls back to a horizontal scroll viewport.
final
confirming bool?
Controlled confirming state. When null, the widget owns its state.
final
confirmingPrimaryFlex int
Primary width share during confirmation.
final
confirmingSecondaryFlex int
Secondary width share during confirmation.
final
confirmIntent UiIntent?
Primary intent during confirmation. Defaults to actionIntent.
final
confirmLabel String
Primary label once confirmation is active.
final
confirmLeading Widget?
Optional primary leading widget during confirmation.
final
curve Curve?
Override transition curve. Defaults to theme standard curve.
final
duration UiMotionDuration
final
hashCode int
The hash code for this object.
no setterinherited
initiallyConfirming bool
Initial uncontrolled confirming state.
final
isProcessing bool
Whether the confirm action is processing.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onCancel VoidCallback?
Called when the confirming secondary button cancels confirmation.
final
onConfirm VoidCallback
Called when the confirming primary button is activated.
final
onConfirmingChanged ValueChanged<bool>?
Called when the confirming state should change.
final
onSecondaryPressed VoidCallback?
Called by the secondary button before confirmation is active.
final
primaryFlex int
Primary width share before confirmation.
final
resetKey Object?
Changing this value resets uncontrolled confirming state.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryDisabled bool
Whether the secondary action is disabled before confirmation.
final
secondaryFlex int
Secondary width share before confirmation.
final
secondaryIntent UiIntent
Secondary intent before confirmation.
final
secondaryLabel String?
Secondary label before confirmation. Defaults to cancelLabel.
final
secondaryLeading Widget?
Optional secondary leading widget before confirmation.
final
secondaryShowBorder bool
Whether to paint the secondary button outline when its style resolves one.
final
semanticLabel String?
Spoken label for the semantic group.
final
size UiSize
Button size applied to both controls.
final
spacing double?
Gap between buttons. Defaults to the token x2 spacing.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<UiConfirmActionGroup>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited