flutter_local_notification has yet to have support for Notification Action Buttons as mentioned on this ticket. You may want to consider using awesome_notifications plugin in the meantime since it has support for notification buttons.
To show notification with Action Button, simply use
void _showNotificationWithButton() {
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 10,
channelKey: 'basic_channel',
title: 'Simple Notification',
body: 'Simple body'),
actionButtons: <NotificationActionButton>[
NotificationActionButton(key: 'yes', label: 'Yes'),
NotificationActionButton(key: 'no', label: 'No'),
],
);
}
You can then add the icon for the Action Button by adding the icon property on NotificationActionButton. The icon should be a String resource of the image mapped in the assets.
To listen for the Action Button press, use an actionStream listener. You can add this on the screen's initState()
AwesomeNotifications().actionStream.listen((receivedNotification) {
// prints the key of the NotificationActionButton pressed
debugPrint('Notification key pressed: ${receivedNotification.buttonKeyPressed}');
});