Skip to content

[go_router] Add routing functions to GoRouteData #9277

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StevenSorial
Copy link

second step of fixing #106790. First PR

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

If you need help, consider asking for advice on the #hackers-new channel on Discord.

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

@StevenSorial
Copy link
Author

@hannah-hyj

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.

LGTM

@@ -280,6 +280,76 @@ void main() {
expect(routeWithDefaultCaseSensitivity.caseSensitive, false);
},
);

testWidgets(
'It should throw beacuase there is not code generated',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'It should throw beacuase there is not code generated',
'It should throw beacuase there is no code generated',

@chunhtai chunhtai requested a review from hannah-hyj May 19, 2025 16:54
@StevenSorial
Copy link
Author

@chunhtai @hannah-hyj Thanks for the approval. There are two things that I would appreciate some help with in this PR:

  • Currently if the user installed go_router >= 15.2.0, but go_router_builder < 3.0.0, the exception would be thrown on navigation. Is there a way to describe this dependency?
  • I don't like how the test I wrote looks 😅 Is there a way to improve it?

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

Successfully merging this pull request may close these issues.

2 participants