modular icon indicating copy to clipboard operation
modular copied to clipboard

WebUrlService not compatible with Flutter Web apps deployed outside of root path

Open camrongiuliani opened this issue 11 months ago • 1 comments

https://github.com/Flutterando/modular/blob/edc191975f51416ba52ffb6f078125dedae15f0c/flutter_modular/lib/src/presenter/navigation/modular_route_information_parser.dart#L55C5-L55C63

When a Flutter Web app is deployed somewhere other than the root of the server, for example: https://www.example.com/flutterapps/myapp

Modular redirects to: https://www.example.com/flutterapps/myapp/#/flutterapps/myapp/

Due to the UrlService being favored over the user defined initial route, there is no clean way to solve for this.

The only way I could find to remedy this is to use a redirect route, but this is less than ideal when the deployment path differs for multiple different clients.

When _firstParse is true, we likely need to prefer the user defined initial route, and if not specified, fallback on the UrlService.

Thoughts?

camrongiuliani avatar Feb 26 '24 18:02 camrongiuliani

Opened a PR for the issue mentioned.

camrongiuliani avatar Feb 26 '24 20:02 camrongiuliani