cancelNotification method

  1. @override
Future<void> cancelNotification(
  1. String notificationId
)
override

Cancel a notification by ID

Implementation

@override
Future<void> cancelNotification(String notificationId) async {
  try {
    await methodChannel.invokeMethod<void>(
      'cancelNotification',
      {'id': notificationId},
    );
  } on PlatformException catch (e) {
    throw Exception('Failed to cancel notification: ${e.message}');
  }
}