CNotification.toast constructor

CNotification.toast({
  1. Key? key,
  2. required Widget title,
  3. required Widget subtitle,
  4. Widget? caption,
  5. bool hideCloseButton = false,
  6. CNotificationKind kind = CNotificationKind.info,
  7. CNotificationContrast contrast = CNotificationContrast.low,
  8. VoidCallback? onCloseButtonTap,
  9. VoidCallback? onClose,
  10. 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);