Skip to content

NotificationView

Rich notification card widget rendering severity icons, titles, messages, action buttons, and auto-dismiss progress.

Overview

NotificationView manages a visual stack of transient notification banners and alert cards on top of application content.

Key features: - Automatic positioning and stacking according to Placement (top-right, bottom-right, etc.). - Animated entry, timed auto-dismissal, and exit transitions. - Severity indicators, customizable icons, titles, and action buttons. - Global and container-level hosting via OverlayLayer.

Displaying Rich Notification Card

NotificationView notifications = new NotificationView();
notifications.toast("Build completed!");
  • OverlayLayer: Full-screen overlay root managing modal backdrops, dialogs, popups, and layer-based hit testing.
  • Toast: Non-intrusive brief notification banner supporting status icons, formatted text, and timed auto-dismiss.

API

NotificationView()

Constructs an empty NotificationView.

NotificationView(String)

Constructs a NotificationView with an initial toast message.

Parameter Type Description
text String Display text string.

NotificationView::activeCount()

Returns the count of active notifications.

Returns int: Total count of items..

NotificationView::addToast(Toast)

Adds a custom Toast instance into the stack.

Parameter Type Description
toast Toast Toast notification card instance.

Returns NotificationView: This widget instance for chaining..

NotificationView::arrangeInHost(RectView)

Arranges the notification cards within host boundaries according to placement.

Parameter Type Description
hostBounds RectView Available host rectangular boundary.

NotificationView::clear()

Clears all active and pending notifications.

Returns NotificationView: This widget instance for chaining..

NotificationView::duration()

Returns the display duration in seconds for new notifications.

Returns float: Display duration in seconds..

NotificationView::duration(float)

Sets the display duration in seconds for new notifications.

Parameter Type Description
seconds float Display duration in seconds before auto-dismissal.

Returns NotificationView: This widget instance for chaining..

NotificationView::hide()

Hides the notification view.

Returns NotificationView: This widget instance for chaining..

NotificationView::margin()

Returns the margin distance from screen edges in UI pixels.

Returns float: Margin distance in pixels..

NotificationView::margin(float)

Sets the margin distance from screen edges.

Parameter Type Description
margin float Margin distance from screen edges.

Returns NotificationView: This widget instance for chaining..

NotificationView::maxVisible()

Returns the maximum number of simultaneously visible notification cards.

Returns int: Maximum visible count..

NotificationView::maxVisible(int)

Sets the maximum number of simultaneously visible notification cards.

Parameter Type Description
maxVisible int Maximum number of simultaneously visible notifications.

Returns NotificationView: This widget instance for chaining..

NotificationView::notifications()

Returns an unmodifiable list of active Toast instances.

Returns List: List of hosted elements..

NotificationView::notify(String)

Synonym pushing a new text toast into the notification stack.

Parameter Type Description
text String Display text string.

Returns NotificationView: This widget instance for chaining..

NotificationView::opened()

Returns true if any notifications are currently active.

Returns boolean: True if currently open..

NotificationView::placement()

Returns the screen corner/edge placement.

Returns Placement: The active placement position..

NotificationView::placement(Placement)

Sets the screen corner/edge placement.

Parameter Type Description
placement Placement Screen corner placement for stacking notifications.

Returns NotificationView: This widget instance for chaining..

NotificationView::show()

Shows the notification view.

Returns NotificationView: This widget instance for chaining..

NotificationView::spacing()

Returns the vertical spacing between stacked notification cards in UI pixels.

Returns float: Spacing distance in pixels..

NotificationView::spacing(float)

Sets the vertical spacing between stacked notification cards.

Parameter Type Description
spacing float Vertical spacing distance between stacked notifications.

Returns NotificationView: This widget instance for chaining..

NotificationView::text()

Returns the text of the latest notification.

Returns String: The displayed text string..

NotificationView::text(String)

Queues a new notification with the given text.

Parameter Type Description
text String Display text string.

Returns NotificationView: This widget instance for chaining..

NotificationView::toast(String)

Pushes a new text toast into the notification stack.

Parameter Type Description
text String Display text string.

Returns NotificationView: This widget instance for chaining..