Notifications are messages that communicate information to the user. The two main variants of notifications are toast notifications and inline notifications.
Widget API
Property
Description
title
The title to display.
Type:Widget
Default: required
subtitle
The subtitle to display.
Type:Widget
Default: required
hideCloseButton
Whether the close button should be disabled, or not.
Type: bool
Default:false
kind
The state that the notification represents. It can be error, info, success, or warning.
Type: CNotificationKind
Default:CNotificationKind.info
lowContrast
Whether you are using the low contrast variant of the notification.
Type: bool
Default:true
onCloseButtonTap
Called when the close button is tapped.
Type:VoidCallback?
Default: optional
onClose
Called after the given timeout duration has passed.
Type:VoidCallback?
Default: optional
actions
A list of CNotificationActionButton to display in a row when the notification is inline.
Type: List<CNotificationActionButton>?
Default: optional
Property
Description
title
The title to display.
Type:Widget
Default: required
subtitle
The subtitle to display.
Type:Widget
Default: required
hideCloseButton
Whether the close button should be disabled, or not.
Type: bool
Default:false
lowContrast
Whether you are using the low contrast variant of the notification.
Type: bool
Default:true
kind
The state that the notification represents. It can be error, info, success, or warning.
Type: CNotificationKind
Default:CNotificationKind.info
onCloseButtonTap
Called when the close button is tapped.
Type:VoidCallback?
Default: optional
onClose
Called after the given timeout duration has passed.
Type:VoidCallback?
Default: optional
caption
An optional caption to display.
Type:Widget?
Default: optional
Property
Description
child
The content of the action button.
Type: Widget
Default: required
onTap
Called when the action button is tapped.
Type: VoidCallback
Default: required
width
The width of the action button. If it's null, the action button will size itself to the child.
Type: double?
Default: optional
height
The height of the action button. If it's null, the action button will size itself to the child.