-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'It should throw beacuase there is not code generated', | |
'It should throw beacuase there is no code generated', |
@chunhtai @hannah-hyj Thanks for the approval. There are two things that I would appreciate some help with in this PR:
|
6199c70
to
d34520a
Compare
d34520a
to
b37c1ac
Compare
b37c1ac
to
a6745b3
Compare
Hi there, I ran into a compilation error after upgrading to go_router_builder 3.0.0 together with go_router 15.1.3. The generated mixin looks like this: mixin _$SplashRoute on GoRouteData {
static SplashRoute _fromState(GoRouterState state) => const SplashRoute();
@override
String get location => GoRouteData.$location('/');
@override
void go(BuildContext context) => context.go(location);
@override
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
// …and so on
} However, in
It looks like the builder is already generating mixins for methods that are only available in an unreleased version of
Happy to provide a minimal repro if it helps. Thanks for looking into this! |
Hi @StevenSorial thanks for contributing! What is the status of thisPR? Were you able to answer the questions you shared above? Looks like CI is happy, just some minor merge conflicts from the changelog and version bump. |
i dont mean to press this issue, but we now have 1000s of warnings of "The method doesn't override an inherited method. |
Hi @Piinks, what questions? I posted two questions for @chunhtai @hannah-hyj, but no one responded. I was hoping for my two PRs to get merged together, but unfortunately only one got merged and caused warnings to appear. |
Thanks for sharing! I will see about getting answers here. :) |
oh i didn't aware the go_router_builder pr needs go_router change, yes in this case this pr needs to be reviewed together with the go_router_builder pr and once both approved, go_router pr needs to merge in first.
there is not much we can do except asking them to upgrade go_router_builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
autosubmit label was removed for flutter/packages/9277, because - The status or check suite Linux_android_legacy android_platform_tests_legacy_api_shard_5 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
autosubmit label was removed for flutter/packages/9277, because - The status or check suite Linux_android android_platform_tests_shard_4 master has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
ci is having issue now |
flutter/packages@6d3aaf4...c5ab57a 2025-06-13 [email protected] [flutter_svg] feat: Expose the renderStrategy property in SvgPicture (flutter/packages#9373) 2025-06-12 [email protected] [go_router] Add routing functions to GoRouteData (flutter/packages#9277) 2025-06-12 [email protected] [various] Update example apps to Swift (flutter/packages#9347) 2025-06-12 [email protected] Roll Flutter from 824868f to f79452e (94 revisions) (flutter/packages#9419) 2025-06-12 [email protected] [android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
second step of fixing [#106790](flutter/flutter#106790). [First PR](flutter#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.
…r#170600) flutter/packages@6d3aaf4...c5ab57a 2025-06-13 [email protected] [flutter_svg] feat: Expose the renderStrategy property in SvgPicture (flutter/packages#9373) 2025-06-12 [email protected] [go_router] Add routing functions to GoRouteData (flutter/packages#9277) 2025-06-12 [email protected] [various] Update example apps to Swift (flutter/packages#9347) 2025-06-12 [email protected] Roll Flutter from 824868f to f79452e (94 revisions) (flutter/packages#9419) 2025-06-12 [email protected] [android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
second step of fixing [#106790](flutter/flutter#106790). [First PR](flutter#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.
second step of fixing #106790. First PR
This PR adds the routing methods
.location
,.go(context)
,.push(context)
,.pushReplacement(context)
, andreplace(context)
toGoRouteData
. They will be overridden by the mixin generated bygo_router_builder
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
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