hello am trying to navigate to a second screen after clicking on notification using flutter_local_notifications https://pub.dev/packages/flutter_local_notifications
final BehaviorSubject<String?> selectNotificationSubject =
BehaviorSubject<String?>();
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
void initializeNotifcations() async {
var initialzationSettings =
InitializationSettings(android: initializationSettingsAndroid);
await flutterLocalNotificationsPlugin.initialize(initialzationSettings,
onDidReceiveBackgroundNotificationResponse:
(NotificationResponse notificationResponse) {
selectNotificationSubject.add(notificationResponse.payload);
});
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()!
.requestPermission();
}
void configureDidReceiveLocalNotificationSubject() {
print('test01');
selectNotificationSubject.stream.listen((String? payload) async {
print('test02');
});
}
not listining to the stream if you got an example of how to make it with the best practice it will help