If you want to cancel all notifications, then you have to do that using the following:
await flutterLocalNotificationsPlugin.cancelAll();
Also, if you want to cancel a specific notification, you can do this by using a specific ID of your notification:
await flutterLocalNotificationsPlugin.cancel(0); // 0 is your notification id
Where this notification ID came from ??
While you are declaring your notification to show on your screen you have to add some data like given below:
await _flutterLocalNotificationsPlugin.show(
0, // this is the notification id
message.notification.title,
message.notification.body,
notificationDetails,
payload: jsonEncode(message.data),
);
Here I am using Flutter Local Notification Plugin to show notifications!!!
Hope this will solve your problem.