Skip to content

Conversation

@justinmc
Copy link
Contributor

I just noticed that these example are using a deprecated member.

@justinmc justinmc requested a review from chunhtai August 22, 2025 17:35
@justinmc justinmc self-assigned this Aug 22, 2025
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

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. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: routes Navigator, Router, and related APIs. labels Aug 22, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly replaces the deprecated onPop member of NavigatorPopHandler with onPopWithResult in the examples. My feedback includes a minor suggestion to align the code with Dart's best practices for handling unused callback parameters, as referenced in the project's style guide.

return NavigatorPopHandler(
onPop: () {
return NavigatorPopHandler<void>(
onPopWithResult: (void result) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To align with Dart best practices as referenced in the style guide, it's recommended to use _ for unused callback parameters and to avoid explicitly typing them as void.1

Suggested change
onPopWithResult: (void result) {
onPopWithResult: (_) {

Style Guide References

Footnotes

  1. The Flutter style guide refers to 'Effective Dart: Style'. This guide recommends using _ for unused callback parameters and advises against using void as a parameter type in function expressions as it's considered redundant. (link)

return NavigatorPopHandler(
onPop: () {
return NavigatorPopHandler<void>(
onPopWithResult: (void result) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To align with Dart best practices as referenced in the style guide, it's recommended to use _ for unused callback parameters and to avoid explicitly typing them as void.1

Suggested change
onPopWithResult: (void result) {
onPopWithResult: (_) {

Style Guide References

Footnotes

  1. The Flutter style guide refers to 'Effective Dart: Style'. This guide recommends using _ for unused callback parameters and advises against using void as a parameter type in function expressions as it's considered redundant. (link)

@justinmc
Copy link
Contributor Author

Gemini's style recommendations go against the Flutter styleguide.

@justinmc
Copy link
Contributor Author

I don't think this change is testable.

@stuartmorgan-g
Copy link
Contributor

test-exempt: code refactor with no semantic change

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

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 25, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Aug 25, 2025
github-merge-queue bot pushed a commit that referenced this pull request Aug 25, 2025
I ran into a case where [Gemini gave me bad code style
advice](#174291 (review))
that it got from Effective Dart even though it conflicted with the
Flutter styleguide. This is my attempt to remedy that.

Fixes #174293
Merged via the queue into flutter:master with commit b7e2e2a Aug 25, 2025
45 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 25, 2025
@justinmc justinmc deleted the on-pop-with-result-examples branch August 25, 2025 22:41
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 26, 2025
flutter/flutter@a4cb00a...c65f01d

2025-08-26 [email protected] Roll Packages from fe66130 to 1ef712e (4 revisions) (flutter/flutter#174442)
2025-08-26 [email protected] Revert "Directly generate a Mach-O dynamic library using gen_snapshot (#171626) (flutter/flutter#174392)
2025-08-26 49699333+dependabot[bot]@users.noreply.github.com Bump codecov/codecov-action from 5.4.0 to 5.5.0 in the all-github-actions group (flutter/flutter#174436)
2025-08-26 [email protected] Roll Skia from 9daab16abbf9 to 21214d63fc40 (1 revision) (flutter/flutter#174431)
2025-08-26 [email protected] Roll Fuchsia Linux SDK from UiY8gj468PZUj6QTm... to L5zGzsIWIS8N36AFQ... (flutter/flutter#174430)
2025-08-26 [email protected] Roll Dart SDK from f1f90d413dd3 to 9054cd8af73c (2 revisions) (flutter/flutter#174428)
2025-08-26 [email protected] Roll Skia from afb5c22d9ba0 to 9daab16abbf9 (2 revisions) (flutter/flutter#174429)
2025-08-26 [email protected] Roll Skia from 2227187dbdcf to afb5c22d9ba0 (1 revision) (flutter/flutter#174425)
2025-08-26 [email protected] [iOS][Secure Paste] Custom edit menu actions (flutter/flutter#171825)
2025-08-26 [email protected] Make SystemUiOverlayStyle to be diagnosticable (flutter/flutter#174018)
2025-08-26 [email protected] Fix: Active step fully colored in vertical mode (flutter/flutter#173152)
2025-08-26 [email protected] Migrate to use `WidgetStateProperty` (flutter/flutter#174323)
2025-08-26 [email protected] Roll Skia from ed42a94ee066 to 2227187dbdcf (3 revisions) (flutter/flutter#174417)
2025-08-26 [email protected] Roll Dart SDK from a0e39d9b4a58 to f1f90d413dd3 (1 revision) (flutter/flutter#174409)
2025-08-26 [email protected] [Impeller] Flush the data written to the device buffer by RoundSuperellipseGeometry (flutter/flutter#174316)
2025-08-26 [email protected] Remove obsolete vulkan_window source files (flutter/flutter#174087)
2025-08-25 [email protected] [web] Migrate non-CanvasKit-specific tests to ui/ (flutter/flutter#174396)
2025-08-25 [email protected] Create Hot Restart over websocket test (flutter/flutter#173852)
2025-08-25 [email protected] Roll Dart SDK from e283a9e88242 to a0e39d9b4a58 (1 revision) (flutter/flutter#174383)
2025-08-25 [email protected] Update `master` CHANGELOG for 3.35.2 (flutter/flutter#174399)
2025-08-25 [email protected] Roll Skia from da724d312e65 to ed42a94ee066 (4 revisions) (flutter/flutter#174394)
2025-08-25 [email protected] Update dwds to 25.0.3 (flutter/flutter#174379)
2025-08-25 [email protected] Fix logic statements in year2023 documentation (flutter/flutter#174120)
2025-08-25 [email protected] Release thread-local resources when submitting a Flutter GPU command buffer (flutter/flutter#173663)
2025-08-25 [email protected] [web] Refactor LayerScene out of CanvasKit (flutter/flutter#174375)
2025-08-25 [email protected] Stream logs from `devicectl` and `lldb` (flutter/flutter#173724)
2025-08-25 [email protected] NavigatorPopScope examples no longer use deprecated onPop. (flutter/flutter#174291)
2025-08-25 [email protected] fix typo in test documentation function name (flutter/flutter#174297)

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
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
I ran into a case where [Gemini gave me bad code style
advice](flutter#174291 (review))
that it got from Effective Dart even though it conflicted with the
Flutter styleguide. This is my attempt to remedy that.

Fixes flutter#174293
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…74291)

I just noticed that these example are using a deprecated member.
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
I ran into a case where [Gemini gave me bad code style
advice](flutter#174291 (review))
that it got from Effective Dart even though it conflicted with the
Flutter styleguide. This is my attempt to remedy that.

Fixes flutter#174293
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…74291)

I just noticed that these example are using a deprecated member.
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
I ran into a case where [Gemini gave me bad code style
advice](flutter#174291 (review))
that it got from Effective Dart even though it conflicted with the
Flutter styleguide. This is my attempt to remedy that.

Fixes flutter#174293
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
…74291)

I just noticed that these example are using a deprecated member.
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
I ran into a case where [Gemini gave me bad code style
advice](flutter#174291 (review))
that it got from Effective Dart even though it conflicted with the
Flutter styleguide. This is my attempt to remedy that.

Fixes flutter#174293
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…74291)

I just noticed that these example are using a deprecated member.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants