ui/wc_alert library
A widget that displays an alert with a custom error message.
The WcAlert widget is a stateless widget that shows an alert box with a specified error message and optional title. It provides customization options for background color and text color.
The alert box includes an error icon, an optional title, and a message. The title is displayed in bold if provided, and the message is displayed below the title.
The WcAlert widget is typically used to show error messages in a user-friendly manner within a Flutter application.
Example usage:
WcAlert(
error: WcBaseError(title: 'Error', message: 'An unexpected error occurred.'),
backgroundColor: Colors.red,
textColor: Colors.white,
)
Parameters:
error: The error object containing the title and message to be displayed.backgroundColor: The background color of the alert box. Defaults to Colors.deepPurple.textColor: The color of the text in the alert box. Defaults to Colors.white.
See also:
- WcBaseError, which defines the structure of the error object.
Classes
Functions
-
showWcAlert(
BuildContext context, WcBaseError error, {Color backgroundColor = Colors.deepPurple, Color textColor = Colors.white, int durationSeconds = 3}) → void