show static method

Future<void> show({
  1. required String title,
  2. required String body,
  3. NotifyIcon? icon,
  4. NotifySound? sound,
  5. List<NotifyAction>? actions,
  6. String? payload,
  7. int? id,
})

Implementation

static Future<void> show({
  required String title,
  required String body,
  NotifyIcon? icon,
  NotifySound? sound,
  List<NotifyAction>? actions,
  String? payload,
  int? id,
}) async {
  final notificationId = id ?? _idCounter++;

  await _channel.invokeMethod('show', {
    'id': notificationId,
    'title': title,
    'body': body,
    'icon': icon?.name,
    'sound': sound?.name,
    'actions': actions?.map((e) => {'id': e.id, 'label': e.label}).toList(),
  });
}