'Flutter Awaesome Notification actionStrem Listen
I am using flutter and for local notification awesome-notification package. I create a notification and send it to the user. When the user clicks on the notification, I will redirect to another page. When the notification that comes on every page of the application is clicked, I will direct you to the page. but this code only listens on the page I put. Where should I put it to listen on each page?
AwesomeNotifications()
.actionStream
.listen((ReceivedNotification receivedNotification) async {
if (channels.contains(receivedNotification.channelKey)) {
print('event received!');
print(receivedNotification.toMap().toString());
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrganizerNotificationScreen(
taskId: receivedNotification.id.toString(),
taskBody: receivedNotification.body,
taskChannel: receivedNotification.channelKey,
),
));
}
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
