notification static method
FlintBox
notification({
- required String message,
- NotificationType type = NotificationType.info,
- String? actionText,
- String? actionUrl,
Create a notification banner
Implementation
static FlintBox notification({
required String message,
NotificationType type = NotificationType.info,
String? actionText,
String? actionUrl,
}) {
final colors = _getNotificationColors(type);
return FlintBox(
children: [
FlintRichText(
children: [
FlintTextSpan(_getNotificationIcon(type),
style: TextStyle(fontSize: 16)),
FlintTextSpan(' $message'),
if (actionText != null && actionUrl != null) ...[
FlintTextSpan(' '),
FlintTextSpan(
actionText,
style: FlintTextStyles.link.copyWith(color: colors.textColor),
onTap: actionUrl,
),
],
],
),
],
padding: EdgeInsets.all(12),
backgroundColor: colors.backgroundColor,
border: BoxBorder(width: 1, color: colors.borderColor),
borderRadius: BorderRadius.circular(4),
);
}