文件最后提交记录最后更新时间
[go _route] fragment parameter added (#8232) ### Description of Change This PR addresses the need for fragments/hashes to be treated as first-party parameters within the go_router package, as highlighted in [issue #150155](https://github.com/flutter/flutter/issues/150155). Previously, users had to manually append the fragment to the URL, which could lead to potential bugs. With this update, the fragment is now a dedicated parameter, allowing for a more seamless and bug-free integration. #### Before: ```dart final location = context.namedLocation('some_route'); // const nested records // Manually adding the fragment, hoping there aren't any weird bugs surrounding it context.replace('$location#https://a.url/that?i=mightuse'); ``` #### After: ```dart // Directly passing the fragment as a parameter context.goNamed("details", fragment: 'https://a.url/that?i=mightuse'); // or final location = GoRouterState.of(context).namedLocation( 'details', fragment: 'section3', ); context.go(location); // or final location = context.namedLocation( 'details', fragment: 'section3', ); context.go(location); ``` ### Issues Fixed This PR resolves [issue #150155](https://github.com/flutter/flutter/issues/150155). --- ## Pre-launch Checklist - [✔️ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [✔️ ] I read the [Tree Hygiene] page, which explains my responsibilities. - [✔️ ] I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.) - [x] I signed the [CLA]. - [✔️ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences] - [✔️ ] I [linked to at least one issue that this PR fixes] in the description above. - [✔️ ] I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes]. - [ ✔️] I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style], or this PR is [exempt from CHANGELOG changes]. - [✔️ ] I updated/added relevant documentation (doc comments with ///). - [ ✔️] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ✔️] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [pub versioning philosophy]: https://dart.dev/tools/pub/versioning [exempt from version changes]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version [following repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style [exempt from CHANGELOG changes]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests1 年前
[go_router] Refactored RouteMatchList and imperative APIs (#5497) This pr refactor RouteMatchList to be a tree structure. Added a common base class RouteMatchBase. It is extended by both RouteMatch and ShellRouteMatch. The RouteMatch is for GoRoute, and is always a leaf node The ShellRouteMatch is for ShellRouteBase, and is always and intermediate node with a list of child RouteMatchBase[s]. This pr also redo how push is processed. Will add a doc explain this shortly. This is a breaking change, will write a migration guide soon. fixes https://github.com/flutter/flutter/issues/134524 fixes https://github.com/flutter/flutter/issues/130406 fixes https://github.com/flutter/flutter/issues/126365 fixes https://github.com/flutter/flutter/issues/125752 fixes https://github.com/flutter/flutter/issues/120791 fixes https://github.com/flutter/flutter/issues/120665 fixes https://github.com/flutter/flutter/issues/113001 fixes https://github.com/flutter/flutter/issues/1105122 年前
[go_router] Fix requestFocus propagation to Navigator (#9177) Fixes [166972](https://github.com/flutter/flutter/issues/166972) ## Pre-Review Checklist [^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.1 年前
[go_router] Fix routing to treat URLs with different cases (e.g., /Home vs /home) as distinct routes. (#9426) Fixes https://github.com/flutter/flutter/issues/169809 ## Pre-Review Checklist [^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.10 个月前
[go_router] fix: PopScope.onPopInvokedWithResult not called in branch routes (#9245) 11 个月前
[go_router] Add support for relative routes (#6825) Add supports for relative routes by allowing going to a path relatively, like go('./$path') This PR doesn't fully resolve any issue, but it's mandatory to further add examples & tests for TypedRelativeGoRoute (see [#7174](https://github.com/flutter/packages/pull/6823)), which will resolves [#108177](https://github.com/flutter/flutter/issues/108177)1 年前
[go_router] Don't log if hierarchicalLoggingEnabled is true (#6019) Fixes https://github.com/flutter/flutter/issues/139667 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*2 年前
[go_router] Add TODOs for meta migration (#9535) Prepares for: https://github.com/flutter/flutter/issues/171410 I created a calendar event for January 30, 2026. Hopefully I'll still employed then 🤞 **Version change exemption reason**, **CHANGELOG exemption reason**, **Test exemption reason**: This only adds comments. No semantic changes. ## Pre-Review Checklist [^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.10 个月前
[go_router] Fixes issue so that the parseRouteInformationWithContext … (#7337) …can handle non-http Uris. fixes https://github.com/flutter/flutter/issues/1483891 年前
[go_router] Fix routing to treat URLs with different cases (e.g., /Home vs /home) as distinct routes. (#9426) Fixes https://github.com/flutter/flutter/issues/169809 ## Pre-Review Checklist [^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.10 个月前
[go_router] Add TODOs for meta migration (#9535) Prepares for: https://github.com/flutter/flutter/issues/171410 I created a calendar event for January 30, 2026. Hopefully I'll still employed then 🤞 **Version change exemption reason**, **CHANGELOG exemption reason**, **Test exemption reason**: This only adds comments. No semantic changes. ## Pre-Review Checklist [^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.10 个月前
[go_router] Add routing functions to GoRouteData (#9277) second step of fixing [#106790](https://github.com/flutter/flutter/issues/106790). [First PR](https://github.com/flutter/packages/pull/9275) This PR adds the routing methods .location, .go(context), .push(context), .pushReplacement(context), and replace(context) to GoRouteData. They will be overridden by the mixin generated by go_router_builder ## Pre-Review Checklist [^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.11 个月前
[go_router] fix Popping state and re-rendering scaffold at the same time doesn't update the URL on web [new] (#8352) > the old pr https://github.com/flutter/packages/pull/6953 Change the 3 files of lib and add a example, because issue https://github.com/flutter/flutter/issues/150312 The reason for the issue is when call counterStream.increment(); will notify notifyListeners() of StreamListener, and finally affect _handleRouteInformationProviderNotification of _RouterState in packages/flutter/lib/src/widgets/router.dart. When pop should not call _handleRouteInformationProviderNotification otherwise will be path wrong. because the value of GoRouteInformationProvider is not the latest. ## Solution: always make the value of GoRouteInformationProvider knew the latest RouteInformation[but not to do notifyListeners()]. i don't know if adding pop to NavigatingType is reasonable, if any place needs to be changed please tell me. ## Result: After changed, the issue been solved and all the others pop not be affect such as drawer/dialog/bottomsheet, See the video below. > https://github.com/flutter/flutter/issues/150312 > exempt from version changes > this PR is exempt from CHANGELOG changes. > this PR is test-exempt. > the go_route_test.dart will error if testWidgets('throw if redirect to itself')[I have this problem when I pull the online branch. it's not relate this PR, All of the others test success, So I view this as all test cases successfully passing.] ``` Exception has occurred. _AssertionError ('package:go_router/src/parser.dart': Failed assertion: line 110 pos 18: '!matchList.last.route.redirectOnly': A redirect-only route must redirect to location different from itself. The offending route: GoRoute#0ae4e(name: null, path: "route", Redirect Only)) ```11 个月前
[go _route] fragment parameter added (#8232) ### Description of Change This PR addresses the need for fragments/hashes to be treated as first-party parameters within the go_router package, as highlighted in [issue #150155](https://github.com/flutter/flutter/issues/150155). Previously, users had to manually append the fragment to the URL, which could lead to potential bugs. With this update, the fragment is now a dedicated parameter, allowing for a more seamless and bug-free integration. #### Before: ```dart final location = context.namedLocation('some_route'); // const nested records // Manually adding the fragment, hoping there aren't any weird bugs surrounding it context.replace('$location#https://a.url/that?i=mightuse'); ``` #### After: ```dart // Directly passing the fragment as a parameter context.goNamed("details", fragment: 'https://a.url/that?i=mightuse'); // or final location = GoRouterState.of(context).namedLocation( 'details', fragment: 'section3', ); context.go(location); // or final location = context.namedLocation( 'details', fragment: 'section3', ); context.go(location); ``` ### Issues Fixed This PR resolves [issue #150155](https://github.com/flutter/flutter/issues/150155). --- ## Pre-launch Checklist - [✔️ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [✔️ ] I read the [Tree Hygiene] page, which explains my responsibilities. - [✔️ ] I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.) - [x] I signed the [CLA]. - [✔️ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences] - [✔️ ] I [linked to at least one issue that this PR fixes] in the description above. - [✔️ ] I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes]. - [ ✔️] I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style], or this PR is [exempt from CHANGELOG changes]. - [✔️ ] I updated/added relevant documentation (doc comments with ///). - [ ✔️] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ✔️] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [pub versioning philosophy]: https://dart.dev/tools/pub/versioning [exempt from version changes]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version [following repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style [exempt from CHANGELOG changes]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests1 年前