AuiAlert class

A themed alert banner that communicates status or feedback to the user.

Supports four semantic variants (AlertVariant.info, AlertVariant.success, AlertVariant.warning, AlertVariant.danger), optional dismiss and action controls, and automatic dark-mode colour inversion.

AuiAlert(
  variant: AlertVariant.success,
  title: 'Saved',
  description: 'Your changes have been saved successfully.',
  onDismiss: () => setState(() => _showAlert = false),
)
Inheritance

Constructors

AuiAlert({Key? key, AlertVariant variant = AlertVariant.info, String? title, String? description, IconData? icon, VoidCallback? onDismiss, Widget? action, bool showIcon = true})
Creates an AuiAlert with full parameter control.
const
AuiAlert.danger({Key? key, String? title, String? description, IconData? icon, VoidCallback? onDismiss, Widget? action, bool showIcon = true})
Creates a danger / error alert.
const
AuiAlert.info({Key? key, String? title, String? description, IconData? icon, VoidCallback? onDismiss, Widget? action, bool showIcon = true})
Creates an informational alert.
const
AuiAlert.success({Key? key, String? title, String? description, IconData? icon, VoidCallback? onDismiss, Widget? action, bool showIcon = true})
Creates a success alert.
const
AuiAlert.warning({Key? key, String? title, String? description, IconData? icon, VoidCallback? onDismiss, Widget? action, bool showIcon = true})
Creates a warning alert.
const

Properties

action Widget?
Optional widget (e.g. a button) placed at the trailing edge of the alert.
final
description String?
Optional body text rendered below title.
final
hashCode int
The hash code for this object.
no setterinherited
icon IconData?
Override the icon. When null and showIcon is true, a sensible default icon is chosen based on variant.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDismiss VoidCallback?
Called when the user taps the dismiss (×) button. When null no dismiss button is shown.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showIcon bool
Whether to show the leading icon. Defaults to true.
final
title String?
Optional bold title rendered above description.
final
variant AlertVariant
The semantic variant that controls colours and the default icon.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited