I am trying this logic that if there is OrderId in notification data then it should open OrdersScreen otherwise open default screen but there is orderId in the data still it opens default screen only i dont know can any one fix this
Homescreen
class _MyHomeScreenState extends State<MyHomeScreen>
with SingleTickerProviderStateMixin {
int _currentPage = 0;
final PageController _pageController = PageController();
Timer? _timer;
bool _isConnected = true;
bool _hasError = false;
//NOTIFICATION
Future<void> _initializeFCM() async {
FirebaseMessaging messaging = FirebaseMessaging.instance;
// Request notification permissions
NotificationSettings settings = await messaging.requestPermission(
alert: true,
badge: true,
sound: true,
);
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
final apnsToken = await FirebaseMessaging.instance.getAPNSToken();
print('Apns: $apnsToken');
print('User granted permission');
final fcmToken = await FirebaseMessaging.instance.getToken();
if (fcmToken != null) {
print('FCM Token: $fcmToken');
}
} else {
print('User declined or has not accepted permission');
}
// Handle background messages
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print('