I am using the Flutter notification_permissions package.
I can retrieve the device notification permission status asynchronously by calling:
PermissionStatus p = await NotificationPermissions.getNotificationPermissionStatus()
However, I do not want to do this just once. I want to listen to the notification status as a stream, so that when it changes I can respond accordingly in my UI.
I tried the following:
NotificationPermissions.getNotificationPermissionStatus().asStream().listen((PermissionStatus s) {
print('Notification permissions: $s');
}
However, this stream does not emit events when I change the notification settings on the device.
How can I achieve this?