Skip to content
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

Allows redirect method to return same location #2773

Merged
merged 2 commits into from
Nov 3, 2022

Conversation

chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Nov 2, 2022

fixes flutter/flutter#106214

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki 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.)
  • 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 listed 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.
  • 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.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 3, 2022
@auto-submit auto-submit bot merged commit d888abd into flutter:main Nov 3, 2022
@ahmednfwela
Copy link
Contributor

on pub.dev for v5.1.3 it states that uri and path parameters should be in GoRouter, but they aren't https://pub.dev/documentation/go_router/5.1.3/go_router/GoRouter-class.html
did this PR override the 5.1.2 one ?

image

@chunhtai
Copy link
Contributor Author

chunhtai commented Nov 3, 2022

@ahmednfwela oops I think I messed up the change log, I will fix it.

You can now use GoRouterState.of(context) to access the uri and path parameters

@ahmednfwela
Copy link
Contributor

@chunhtai but what if I don't have the context (e.g. in controller-based architecture) ? how can I access the path parameters ?

@chunhtai
Copy link
Contributor Author

chunhtai commented Nov 3, 2022

@chunhtai but what if I don't have the context (e.g. in controller-based architecture) ? how can I access the path parameters ?

use a Builder widget

@ahmednfwela
Copy link
Contributor

what I mean is accessing the parameters outside the flutter widget tree, where I am relying entirely on the GoRouter instance to listen for notifications and access path parameters

@chunhtai
Copy link
Contributor Author

chunhtai commented Nov 3, 2022

@ahmednfwela That is a use case i have not thought about, can you open an issue so that we can discuss in there?

@ahmednfwela
Copy link
Contributor

@chunhtai I have opened flutter/flutter#114642

percula pushed a commit to percula/packages that referenced this pull request Nov 17, 2022
* Allows redirect method to return same location

* format and bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: go_router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[go_router] Allow redirecting to the current location
3 participants