Alert constructor

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

Creates an Alert with standard styling.

All content parameters are optional, allowing for flexible layouts from simple text alerts to complex multi-element notifications.

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
  • destructive (bool, default: false): Whether to use destructive styling

Example:

Alert(
  title: Text('Success'),
  content: Text('Operation completed successfully.'),
);

Implementation

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