cancelNotification method

Future<void> cancelNotification(
  1. int id, {
  2. String? tag,
})

Cancels a specific notification

Implementation

Future<void> cancelNotification(int id, {String? tag}) async {
  if (!_isInitialized) {
    throw StateError(
        'PlatformNotificationService must be initialized before canceling notifications');
  }

  await _flutterLocalNotificationsPlugin.cancel(id, tag: tag);
}