CKNotification.builder constructor
CKNotification.builder({
- required String uuid,
- required String title,
- String? icon,
- String? body,
- int? badge,
- CKNotificationDirection? dir,
- bool? renotify,
- bool? requireInteraction,
- bool? silent,
- String? image,
- String? lang,
- VibratePattern? vibrate,
- int? timestamp,
- List<
CKNotificationAction> actions = const [], - Map<
String, dynamic> ? data, - Map<
String, dynamic> ? metadata,
Create a CKNotification using a factory builder, allows constructing a JsNotification via
individual properties. Allows providing a list of actions
and metadata
using within the
CallKit plugin.
Implementation
factory CKNotification.builder({
required String uuid,
required String title,
String? icon,
String? body,
int? badge,
CKNotificationDirection? dir,
bool? renotify,
bool? requireInteraction,
bool? silent,
String? image,
String? lang,
VibratePattern? vibrate,
int? timestamp,
List<CKNotificationAction> actions = const [],
Map<String, dynamic>? data,
Map<String, dynamic>? metadata,
}) {
final options = JSNotificationOptions(
icon: icon,
data: data,
body: body,
renotify: renotify,
requireInteraction: requireInteraction,
tag: uuid,
silent: silent,
actions: actions,
badge: badge,
dir: dir?.js,
image: image,
lang: lang,
vibrate: vibrate,
timestamp: timestamp,
);
final notification = JSNotification(title, options);
return CKNotification(uuid, notification, metadata ?? const {});
}