Reputation: 1706
Future<void> create({
required String key,
required String title,
required String body,
required String bigPicture,
}) async {
await _notiff.createNotification(
content: NotificationContent(
id: DateTime.now().millisecondsSinceEpoch.remainder(10),
channelKey: key,
title: title,
body: body,
bigPicture: bigPicture,
notificationLayout: NotificationLayout.BigPicture,
),
actionButtons: [
NotificationActionButton(
buttonType: ActionButtonType.InputField,
enabled: true,
label: "Comment",
key: "COMMENT_BUTTON_KEY")
]);
}
Upvotes: 1
Views: 727
Reputation: 1
AwesomeNotifications().actionStream.listen(
(ReceivedNotification receivedNotification){
if (event.buttonKeyPressed == "COMMENT_BUTTON_KEY"){
String userComment = event.buttonKeyInput;}
);
Upvotes: 0
Reputation: 869
Do you need create listener to get new notifications like this:
AwesomeNotifications().actionStream.listen(
(ReceivedNotification receivedNotification){
Navigator.of(context).pushNamed(
'/NotificationPage',
arguments: {
// your page params. I recommend you to pass the
// entire *receivedNotification* object
id: receivedNotification.id
}
);
}
);
PD: Do you need replace with your data, this information is in docs (5. How to show Local Notifications)
Upvotes: 2