Alert.destructive constructor

const Alert.destructive({
  1. Key? key,
  2. Widget? leading,
  3. Widget? title,
  4. Widget? content,
  5. Widget? trailing,
})

Creates an Alert with destructive styling pre-configured.

This is a convenience constructor that sets destructive to true, applying error/warning colors to text and icons automatically.

Parameters:

  • leading (Widget?, optional): Icon or widget at the start
  • title (Widget?, optional): Main heading or message
  • content (Widget?, optional): Detailed description or body
  • trailing (Widget?, optional): Action buttons or dismissal controls

Example:

Alert.destructive(
  leading: Icon(Icons.error),
  title: Text('Error'),
  content: Text('Something went wrong. Please try again.'),
);

Implementation

const Alert.destructive({
  super.key,
  this.leading,
  this.title,
  this.content,
  this.trailing,
}) : destructive = true;