GlassConfirmationDialogAction class

A single action button displayed inside showGlassConfirmationDialog.

Mirrors SwiftUI's Button roles inside .confirmationDialog() and UIKit's UIAlertAction:

  • Pass onPressed as null to keep the action visible in a disabled state (neutral capsule wash with CupertinoColors.tertiaryLabel text).
  • Set isDestructive to true for dangerous actions (e.g. Delete), which render with CupertinoColors.systemRed text.
  • Set isPrimary to true for a prominent default action filled with tintColor (or CupertinoTheme.of(context).primaryColor), auto-contrasted label text, and hardware Return/Enter key activation when a single primary action is present.

Constructors

GlassConfirmationDialogAction({required String label, required VoidCallback? onPressed, Widget? icon, bool isDestructive = false, bool isPrimary = false, Color? tintColor, Color? foregroundColor, bool dismissOnPress = true})
Creates a confirmation dialog action.
const

Properties

dismissOnPress → bool
Whether tapping this action automatically dismisses the confirmation dialog after onPressed runs.
final
foregroundColor → Color?
Optional foreground text/icon color override when this action is enabled.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → Widget?
Optional leading icon widget displayed before label.
final
isDestructive → bool
Whether this is a destructive action (e.g. delete or discard).
final
isPrimary → bool
Whether this is the primary (recommended) action.
final
label → String
Label text displayed inside the action capsule.
final
onPressed → VoidCallback?
Callback invoked when the action is tapped or activated from the keyboard.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tintColor → Color?
Optional custom accent fill color for this action.
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