@@ -21,11 +21,11 @@ class DeepLinkInterceptor extends WidgetsBindingObserver {
2121 @override
2222 Future <bool > didPushRouteInformation (RouteInformation routeInformation) async {
2323 final uri = routeInformation.uri;
24- _logger.i ('Route information received: $uri ' );
24+ _logger.i ('DeepLinkInterceptor: Route information received: $uri ' );
2525
2626 // Check if this is a custom scheme URL
2727 if (_isCustomScheme (uri)) {
28- _logger.i ('Custom scheme detected: ${uri .scheme }, intercepting' );
28+ _logger.i ('DeepLinkInterceptor: Custom scheme detected: ${uri .scheme }, intercepting and preventing GoRouter processing ' );
2929
3030 // Emit the custom URL for processing
3131 _customUrlController.add (uri.toString ());
@@ -35,12 +35,32 @@ class DeepLinkInterceptor extends WidgetsBindingObserver {
3535 return true ;
3636 }
3737
38+ _logger.i ('DeepLinkInterceptor: Allowing normal URL to pass through: $uri ' );
3839 // Let normal URLs pass through to GoRouter
3940 return super .didPushRouteInformation (routeInformation);
4041 }
4142
4243 // Note: didPushRoute is deprecated, but we keep it for compatibility
4344 // The main handling is done in didPushRouteInformation above
45+ @override
46+ // ignore: deprecated_member_use
47+ Future <bool > didPushRoute (String route) async {
48+ _logger.i ('DeepLinkInterceptor: didPushRoute called with: $route ' );
49+
50+ try {
51+ final uri = Uri .parse (route);
52+ if (_isCustomScheme (uri)) {
53+ _logger.i ('DeepLinkInterceptor: Custom scheme detected in didPushRoute: ${uri .scheme }, intercepting' );
54+ _customUrlController.add (route);
55+ return true ;
56+ }
57+ } catch (e) {
58+ _logger.w ('DeepLinkInterceptor: Error parsing route in didPushRoute: $e ' );
59+ }
60+
61+ // ignore: deprecated_member_use
62+ return super .didPushRoute (route);
63+ }
4464
4565 /// Check if the URI uses a custom scheme
4666 bool _isCustomScheme (Uri uri) {
0 commit comments