Skip to content

fix: update browser URL on Routefly.pop to previous route & do not parse hex url query params as number#34

Open
RyanHolanda wants to merge 2 commits into
Flutterando:mainfrom
RyanHolanda:main
Open

fix: update browser URL on Routefly.pop to previous route & do not parse hex url query params as number#34
RyanHolanda wants to merge 2 commits into
Flutterando:mainfrom
RyanHolanda:main

Conversation

@RyanHolanda

@RyanHolanda RyanHolanda commented Oct 4, 2025

Copy link
Copy Markdown
Contributor

While using Routefly on Flutter Web, Routefly.pop did not update the browser URL to the previous route, causing history/refresh inconsistencies. Additionally, hex-looking URL query params (e.g., Ethereum addresses like “0x4e68ccd3e89f51c3074ca5072bbac773960dfa36”) were being parsed as numbers when accessed via Routefly.query[].

This PR fixes:
• Browser URL on pop: the router sets the URL to the last non-push configuration (calls setNewRoutePath on pop).
• Root path filtering: PushNavigate filters out the root path ("/") when rebuilding across routes to prevent "/" from becoming the last route accidentally.
• Query parsing: do not parse hex-like query params (values starting with "0x") as numbers, keep them as strings to preserve Ethereum addresses and similar identifiers.

Impact:
• Correct browser history behavior on pop.
• Prevents stale root entries in the navigation stack.
• Preserves hex query params (e.g., Ethereum addresses) as strings, preventing unintended numeric parsing.
• Tested on Flutter Web (browser back/refresh now reflect the previous route; hex queries remain intact).
• No breaking changes to mobile navigation.

@RyanHolanda RyanHolanda changed the title fix: update browser URL on Routefly.pop to previous route fix: update browser URL on Routefly.pop to previous route & do not parse hex url query params as number Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant