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

[Go_Router] 117514: Added hasRoute to GoRouter - Checks if the given path matches a registered route #3003

Closed
wants to merge 2 commits into from
Closed

Conversation

dancamdev
Copy link
Contributor

@dancamdev dancamdev commented Dec 24, 2022

This is the implementation for a new feature suggested in 117514

The issue does a great job explaining the use case.

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.

@ahmednfwela
Copy link
Contributor

instead of a hasRoute, can't we expose a tryParseRoute instead ? it will return RouteMatchList? which is more useful than just true/false

@dancamdev
Copy link
Contributor Author

instead of a hasRoute, can't we expose a tryParseRoute instead ? it will return RouteMatchList? which is more useful than just true/false

This provides a clearer API in my opinion, yes.

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.

We should open up the API before we do this. Right now I think the RoutMatchList is package level private.

@ahmednfwela
Copy link
Contributor

@chunhtai are there specific members you want to hide/remove ? I think the current state of the package is too strict, as it's very hard to edit/use internal behavior without a complete fork of the package.
this goes back to the discussion in flutter/flutter#107757

@chunhtai
Copy link
Contributor

chunhtai commented Jan 5, 2023

I think we should be able to open up all of them now, just need a bit more refactoring. It is the next thing on my list.

There shouldn't be any package level private, and it is not really private anyway...

@stuartmorgan
Copy link
Contributor

@chunhtai What's the status of this PR? Should it be marked as a Draft until the refactorings you referred to are completed?

@chunhtai
Copy link
Contributor

chunhtai commented Feb 2, 2023

Closing this pr as this would not be needed if the we open up the API.

@chunhtai chunhtai closed this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants