magic_notifications library

Classes

ChannelPreference
Channel-specific preferences for a notification type.
DatabaseChannel
Database channel for in-app notifications.
DatabaseNotification
Database notification model for in-app notifications.
MagicNotificationsArtisanProvider
ArtisanServiceProvider for Magic Notifications.
Notification
Base class for notifications
NotificationChannel
Base class for notification channels
NotificationDropdown
Bell icon dropdown with a real-time unread badge over a notification stream.
NotificationManager
Core notification manager.
NotificationPoller
Polls for notifications at regular intervals.
NotificationPreference
Model for user notification preferences.
NotificationPreferencesController
Controller behind the notification preference matrix.
NotificationPreferencesView
The notification preference screen.
NotificationServiceProvider
Binds notifications into magic's container and wires the push driver.
NotificationsListController
Controller behind the notification list screen.
NotificationsListView
The full notification list screen.
NotificationViewRegistry
Registry for notification view builders.
Notify
Notification facade.
OneSignalDriver
OneSignal push notification driver for mobile platforms (iOS/Android).
PaginatedNotifications
Paginated wrapper for database notifications.
PushChannel
Push notification channel using a configured driver (e.g., OneSignal).
PushDeliverySnapshot
Whether a push can reach this device, in a shape a server can store.
PushDriver
Abstract driver for push notification services.
PushIdentityChange
Event fired when the push SDK reports an identity or subscription change.
PushIdentityReconciled
The outcome of one push identity reconcile pass that had a driver to act on.
PushMessage
A push notification message with fluent builder pattern.
PushNotificationEvent
Event fired when a push notification is received or clicked.
PushOffNotice
A quiet, tappable marker that this device cannot be reached by push.
PushPrompt
The push permission soft prompt.
PushPromptAdvice
Whether the app may remind somebody about push, and what the reminder can do about it.
PushPromptHost
The push prompt wired to the platform.
PushStateReporter
Tells the host's backend whether a push sent to this device would arrive, and stops this device vouching for a person who signs out of it.
PushSubscription
Represents a push notification subscription.
PushUserAttributes
What the push platform is told about the person on this device.

Enums

PushPermissionState
Push notification permission states.
PushPromptAction
What an app's own push reminder can actually accomplish right now.
PushReachability
Whether push can actually reach a device right now.

Mixins

Notifiable
Mixin for entities that can receive notifications

Constants

kNotificationDropdownBadgeClassName → const String
The default className of the unread badge pill.
kNotificationDropdownBadgeTextClassName → const String
The default className of the unread count inside the badge pill.
kNotificationDropdownPanelClassName → const String
The default className of the popover panel (the dropdown surface).
kNotificationDropdownTriggerClassName → const String
The default className of the trigger surface (the box around the bell).
kNotificationDropdownTriggerIconClassName → const String
The default className of the trigger glyph (the bell itself).
kPushOffNoticeDensityAxis → const String
The density axis key for the shell notice.
kPushOffNoticeDensityCompact → const String
The mobile top-bar form: the glyph alone, sized like an account avatar.
kPushOffNoticeDensityFull → const String
The sidebar form: a glyph and a line, sized like a nav row.
kPushPromptStateAsk → const String
The ask presentation: the soft prompt, and the compact enable row.
kPushPromptStateAxis → const String
The state axis key shared by the three push-prompt recipes.
kPushPromptStateBlocked → const String
The blocked presentation: the platform will not prompt again.
kPushPromptStateOn → const String
The on presentation: this device is reachable.
kPushPromptStateUnavailable → const String
The unavailable presentation: this build has no push at all.
magicNotificationsVersion → const String
Version the seven notifications:* command banners print.
pushOffNoticeIconClassName → const String
The shell notice's glyph className.
pushOffNoticeLabelClassName → const String
The shell notice's label className, matching a sidebar's secondary rows.
pushOffNoticeRecipe → const WindRecipe
Builds the shell notice's WindRecipe.
pushPromptActionsClassName → const String
The single-button and two-button actions row shared by every action state.
pushPromptDeclineButtonClassName → const String
The decline ("not now") button's className.
pushPromptEnableButtonClassName → const String
The "enable push" button's className.
pushPromptIconRecipe → const WindRecipe
Builds the glyph WindRecipe for the icon inside the tile.
pushPromptRecipe → const WindRecipe
Builds the push-prompt container WindRecipe.
pushPromptTileRecipe → const WindRecipe
Builds the glyph tile WindRecipe that leads every push-prompt row.

Typedefs

NotificationLayoutBuilder = Widget Function(Widget child)
Builds a layout widget wrapping child for a registry key.
NotificationModalBuilder = Widget Function()
Builds a modal widget for a registry key.
NotificationSlotBuilder = Widget Function(BuildContext context)
Slot builder receives the current BuildContext and returns a widget.
NotificationViewBuilder = Widget Function()
Builds a view widget for a registry key.
PushUserAttributesResolver = PushUserAttributes? Function(String externalId)
Answers what the push platform should be told about the person a device is subscribed as.

Exceptions / Errors

NotificationException
Base exception for notification errors
UnsupportedPlatformException
Thrown when a call needs a push driver this build has no arm for.