CNotification.toast constructor
CNotification.toast({
- Key? key,
- required Widget title,
- required Widget subtitle,
- bool hideCloseButton = false,
- CNotificationKind kind = CNotificationKind.info,
- CNotificationContrast contrast = CNotificationContrast.low,
- VoidCallback? onCloseButtonTap,
- VoidCallback? onClose,
- int? timeout,
Implementation
CNotification.toast({
Key? key,
required Widget title,
required Widget subtitle,
Widget? caption,
bool hideCloseButton = false,
CNotificationKind kind = CNotificationKind.info,
CNotificationContrast contrast = CNotificationContrast.low,
VoidCallback? onCloseButtonTap,
VoidCallback? onClose,
int? timeout,
}) : assert((timeout == null && onClose == null) || (timeout != null && onClose != null)),
assert((hideCloseButton && onCloseButtonTap == null) || (!hideCloseButton && onCloseButtonTap != null)),
props = CNotificationToastProps(
caption: caption,
title: title,
subtitle: subtitle,
hideCloseButton: hideCloseButton,
kind: kind,
contrast: contrast,
onCloseButtonTap: onCloseButtonTap,
onClose: onClose,
timeout: timeout,
),
_type = CNotificationType.toast,
super(key: key);