isPrimary property

bool isPrimary
final

Whether this is the primary (recommended) action.

Mirrors UIKit's UIAlertController.preferredAction and SwiftUI's .keyboardShortcut(.defaultAction) inside .alert:

  • On GlassStyle.ios27 and GlassStyle.ios26, an enabled non-destructive primary action fills its capsule with tintColor (defaulting to CupertinoTheme.of(context).primaryColor) and draws FontWeight.w600 luminance-contrasted white or black text (overridable via foregroundColor).
  • If isDestructive is also true (and tintColor is null), the action keeps the neutral capsule with FontWeight.w600 red text, matching native iOS 26/27.
  • When disabled (onPressed == null), the capsule reverts to the neutral wash with CupertinoColors.tertiaryLabel text.
  • When a single primary action is present and enabled, pressing the hardware Return / Enter key activates it directly (unless another button or a text input inside GlassDialog.content handles the key).
  • On GlassStyle.classic, renders a prominent tinted GlassButton.

Apple HIG recommends marking at most one action per dialog as primary.

Defaults to false.

Implementation

final bool isPrimary;