文件最后提交记录最后更新时间
[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 _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] Secured empty matches in canPop (#8557) If current configuration matches is empty, canPop throws exceptions instead of quit properly ``` StateError: Bad state: No element App 0x1086b3e80 List.last (growable_array.dart:349) App 0x108996274 GoRouterDelegate.canPop (delegate.dart:84) App 0x1089961bc GoRouter.canPop (router.dart:330) App 0x10899615c BuildContextExtension|get#_shouldPop (build_context_extensions.dart:40) ``` - if there are no elements, poping page throws an error1 年前
[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] Adds caseSensitive to GoRoute (#8992) Fixes https://github.com/flutter/flutter/issues/162487 Fixes https://github.com/flutter/flutter/issues/166576 ## 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] Fixes issue so that the parseRouteInformationWithContext … (#7337) …can handle non-http Uris. fixes https://github.com/flutter/flutter/issues/1483891 年前
[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] Adds caseSensitive to GoRoute (#8992) Fixes https://github.com/flutter/flutter/issues/162487 Fixes https://github.com/flutter/flutter/issues/166576 ## 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] Add missing caseSensitive parameter to GoRouteData.$route (#9126) Part of https://github.com/flutter/flutter/issues/167277 I missed this parameter in https://github.com/flutter/packages/pull/9096. This PR adds it. After that, I'll be able to make a PR for 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.1 年前
[go_router] Fix return type of current state getter to be non-nullable (#8173) The state getter returns a GoRouterState?, but I don't think it needs to be nullable since currentConfiguration.last.buildState() never returns null. I'm not sure if it is nullable on purpose for some changes planned in the Future. If there is a reason, it might be better to add a comment about it. Otherwise, it is just inconvenient that a null check is necessary.1 年前
[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 年前