Notifications

Generated reference for ovok_flutter: notifications.

  • Stable unknown
  • Release candidate since 0.1.0-rc.6
  • Development since 0.1.0-dev.32+1028d01

PushNotificationContent

class PushNotificationContent

Content for a local notification.

Constructors

PushNotificationContent.new

PushNotificationContent({
  required String title,
  String? body,
  Map<String, Object?>? data,
})

Creates notification content.

ParameterTypeKindDefault
titleStringrequired named
bodyString?named
dataMap<String, Object?>?named

Properties

PushNotificationContent.title

final String title

Notification title.

PushNotificationContent.body

final String? body

Notification body text.

PushNotificationContent.data

final Map<String, Object?>? data

Extra scalar data delivered in the notification payload.

PushNotificationPermissionStatus

enum PushNotificationPermissionStatus

Notification permission state.

Values

PushNotificationPermissionStatus.granted

static const PushNotificationPermissionStatus granted

Notifications are allowed.

PushNotificationPermissionStatus.denied

static const PushNotificationPermissionStatus denied

Notifications are blocked by the user or operating system.

PushNotificationPermissionStatus.undetermined

static const PushNotificationPermissionStatus undetermined

The app may still request notification permission.

getPushNotificationPermission

Future<PushNotificationPermissionStatus> getPushNotificationPermission()

Reads the current notification permission without showing a prompt.

requestPushNotificationPermission

Future<PushNotificationPermissionStatus> requestPushNotificationPermission()

Requests notification permission. Call this while the app is in the foreground.

showPushNotification

Future<void> showPushNotification(PushNotificationContent content)

Shows a local notification with optional scalar data in its payload.

ParameterTypeKindDefault
contentPushNotificationContentpositional

Last updated on

On this page