Skip to content

Conversation

@CaoGiaHieu-dev
Copy link
Contributor

@CaoGiaHieu-dev CaoGiaHieu-dev commented Nov 5, 2025

Add _refreshKey to MatchBase and update GoRouter.refresh() logic

This maybe fix: flutter/flutter#175399

Pre-Review Checklist

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-assist bot 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

  1. 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

@github-actions github-actions bot added p: go_router platform-ios triage-framework Should be looked at in framework triage labels Nov 5, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

CaoGiaHieu-dev and others added 4 commits November 5, 2025 10:46
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)
CaoGiaHieu-dev and others added 4 commits November 5, 2025 10:49
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>
Copy link
Contributor

@chunhtai chunhtai left a 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

@CaoGiaHieu-dev
Copy link
Contributor Author

CaoGiaHieu-dev commented Nov 7, 2025

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 _refreshKey in RoutematchList to notify the _CustomNavigator since it was only notify when matchList was changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: go_router triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go_router]: GoRouter.refresh() does not trigger route rebuild/refresh

2 participants