-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[go_router]: Fix GoRouter.refresh() trigger route rebuild/refresh
#10363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses the issue of GoRouter.refresh() not triggering a widget rebuild by introducing a refreshKey to RouteMatchBase and revamping the refresh() logic. The inclusion of a comprehensive example and thorough tests is commendable. My review includes a few suggestions to enhance the robustness of the key generation mechanism, ensure ShellRoutes are also correctly refreshed, and improve the clarity of the changelog entry.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* 'main' of https://github.com/CaoGiaHieu-dev/packages: Update packages/go_router/CHANGELOG.md [tool] Remove use of FETCH_HEAD (flutter#10357) Roll Flutter from 027f2e410241 to e5d5c01850f2 (73 revisions) (flutter#10362) [camera_platform_interface] Adds support for video stabilization to camera_platform_interface (flutter#10337) [google_maps_flutter] Raise `MapUsedAfterWidgetDisposedError` when map controller used after map disposed (flutter#9242) [pigeon] Replace containsKey with contains in Kotlin generator (flutter#10274) [video_player] Remove `package` in example `AndroidManifest.xml` file (flutter#10245) [flutter_svg] Fixes typo of `allowDrawingOutsideViewBox` in doc comments. (flutter#10256) [in_app_purchase] Remove use of Pigeon's Dart test generator (flutter#10328) [dependabot]: Bump com.squareup.okhttp3:okhttp from 5.1.0 to 5.3.0 in /packages/espresso/android (flutter#10348) Roll Flutter from 6f8abdd77820 to 027f2e410241 (26 revisions) (flutter#10335) [google_sign_in] Remove use of OCMock (flutter#10290) [interactive_media_ads] Pin iOS dependency maximum (flutter#10349)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the RoutematchList doesn't change, why do we want to force a rebuild in the RouterDelegate? I thought the point to do the refresh is that the redirect would produce a different result
My intention is to update the |
Add
_refreshKeytoMatchBaseand updateGoRouter.refresh()logicThis maybe fix: flutter/flutter#175399
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3