Skip to content

Conversation

@ClaireDavis
Copy link
Contributor

This pr added the ability to provide a list of NavigatorObservers to a ShellRoute. The equivalent was never added to go_router_builder, so this pr provides that functionality.

This is a workaround to this issue where navigator observers added to a GoRouter at the top level do not fire in ShellRoutes. With this change, you can provide NavigatorObservers directly to the ShellRoute

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.

@ClaireDavis ClaireDavis requested a review from chunhtai as a code owner December 4, 2023 14:55
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@ClaireDavis
Copy link
Contributor Author

My intent is to add a test, but in order to do so I'll need to pull in Flutter as a dependency and I'm not sure why that hasn't happened yet (seems like it should have happened for adding a GlobalKey for NavigatorState on ShellRoutes) so I wanted the go-ahead before doing that.

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, please update the version bump

@chunhtai chunhtai requested a review from hannah-hyj December 7, 2023 20:24
@ClaireDavis ClaireDavis requested a review from chunhtai December 7, 2023 20:38
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

Copy link
Member

@hannah-hyj hannah-hyj left a comment

Choose a reason for hiding this comment

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

LGTM

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 7, 2023
@auto-submit auto-submit bot merged commit 6e1ffca into flutter:main Dec 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 8, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 8, 2023
flutter/packages@15584a3...6cd0657

2023-12-08 [email protected] [gis_web] Correct pub.dev changelog entry. (flutter/packages#5613)
2023-12-08 [email protected] Add the ability to run web_benchmarks with Wasm (flutter/packages#5611)
2023-12-08 [email protected] [google_sign_in] Endorse macOS implementation (flutter/packages#5600)
2023-12-07 [email protected] [go_router_builder] add support to `go_router_builder` for initializing a `ShellRoute` with `observers` (flutter/packages#5563)
2023-12-07 [email protected] [go_router] Fix(docs): Typo in Update navigation.md (flutter/packages#5545)
2023-12-07 [email protected] [two_dimensional_scrollables] Expose addAutomaticKeepAlives in Table delegates (flutter/packages#5597)
2023-12-07 [email protected] [pigeon] Fix pigeon issue_tracker link (flutter/packages#5505)
2023-12-07 [email protected] Pointer interceptor implementations (flutter/packages#5594)

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],[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
@reidbaker reidbaker mentioned this pull request Jan 12, 2024
if (parameterName.toLowerCase().contains('navigatorkey')) {
if (parameterName
.toLowerCase()
.contains(RegExp('navigatorKey | observers'))) {

Choose a reason for hiding this comment

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

Won't this no longer match against navigatorKey due to the toLowerCase() call? It also would require a space after navigatorKey or before observers in order to actually match

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_builder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants