Alert.destructive constructor
const
Alert.destructive({})
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 starttitle
(Widget?, optional): Main heading or messagecontent
(Widget?, optional): Detailed description or bodytrailing
(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;