Skip to content

Conversation

FMorschel
Copy link
Contributor

It was found, at the issue below, a false-negative for the avoid_redundant_argument_values lint where it wasn't triggered for annotations. This PR simply removes the redundant arguments.

Pre-Review Checklist

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

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

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

Copy link

@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 focuses on code cleanup by removing redundant arguments in annotations, addressing a lint for avoid_redundant_argument_values. The changes are applied to TypedShellRoute annotations in test files for go_router_builder and a JsonKey annotation in in_app_purchase_storekit. The changes are straightforward and improve code conciseness.

///
/// You set up offers and their identifiers in App Store Connect.
@JsonKey(defaultValue: null)
@JsonKey()

Choose a reason for hiding this comment

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

medium

Thanks for removing the redundant defaultValue: null. However, it looks like the corresponding generated file, sk_product_wrapper.g.dart, hasn't been updated. As noted in the file header, changes to @JsonSerializable classes require running the build runner. Please run the generator and commit the updated .g.dart file to ensure the generated code is in sync with this change.

@FMorschel FMorschel marked this pull request as draft September 8, 2025 15:17
@FMorschel FMorschel changed the title [go_router_builder] Removes redundant arguments from annotations [go_router_builder] [in_app_purchase_storekit] Removes redundant arguments from annotations Sep 8, 2025
@FMorschel FMorschel marked this pull request as ready for review September 8, 2025 19:31
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 for go_router part

late SKPaymentTransactionStateWrapper response;
late SKSubscriptionPeriodUnit unit;
late SKProductDiscountPaymentMode discountPaymentMode;
late SKProductDiscountType discountType;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @LouiseHsu this class doesn't seem to be read by anyone, and the code generator seems to be generating _$SKProductDiscountTypeEnumMap just fine without it being added to _SerializedEnums. Do you think this type can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and the code generator seems to be generating _$SKProductDiscountTypeEnumMap just fine without it being added to _SerializedEnums.

I couldn't do without it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with json_serializable.dart, but the following code already exists in enum_converters.g.dart today:

const _$SKProductDiscountTypeEnumMap = {
  SKProductDiscountType.introductory: 0,
  SKProductDiscountType.subscription: 1,
};

you mean if you rerun code gen the above map const is removed from the generated source code, without that new field in _SerializedEnums?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean if you rerun code gen the above map const is removed from the generated source code, without that new field

Exactly. See the second commit on this branch, I simply ran the build and pushed, expecting any diagnostics to be stale analysis that would get fixed once it was updated. Once I saw the bots failed, I actually looked at the output and diagnostics.

So I had to add that and remove the ? from the map key for it to build. It was also warning on the terminal (while building) about the annotations version, so I upgraded it as well.

I'm not sure why this line was missing, if it was removed by mistake or something, but it would not generate this without it.

@LongCatIsLooong
Copy link
Contributor

The CI is complaining about missing versionbump / changelog (see: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates). The IAP change seems to involve a signature change, could you bump the version of that package?

@FMorschel
Copy link
Contributor Author

I'd asked about it at #9964 (comment). Will do. Thanks!

@LongCatIsLooong
Copy link
Contributor

@chunhtai do you think the go_router_builder change needs a version bump (I think that's blocking the CI)? If not I think we should put on the override tag.

@FMorschel
Copy link
Contributor Author

do you think the go_router_builder change needs a version bump (I think that's blocking the CI)? If not I think we should put on the override tag.

@chunhtai, sorry for the new ping, but maybe you didn't see the one above?

@chunhtai chunhtai added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Sep 23, 2025
@chunhtai
Copy link
Contributor

reason for override, test only file formatting

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 23, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 23, 2025
Copy link
Contributor

auto-submit bot commented Sep 23, 2025

autosubmit label was removed for flutter/packages/9964, because - The status or check suite Linux_desktop build_all_packages stable has failed. Please fix the issues identified (or deflake) before re-applying this label.

@FMorschel
Copy link
Contributor Author

It says the bot was cancelled (if I understood it correctly). Do I need to do anything?

@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 23, 2025
@auto-submit auto-submit bot merged commit bbc7da4 into flutter:main Sep 23, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 24, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Sep 24, 2025
flutter/packages@3413b65...117bf63

2025-09-24 [email protected] [ci] Add update-release-info command
suggestion when version check fails (flutter/packages#9834)
2025-09-24 [email protected] Manual roll Flutter from
9ff2767 to 4a04204 (28 revisions) (flutter/packages#10067)
2025-09-24 [email protected] Remove "All right reserved" from all
files (flutter/packages#10066)
2025-09-24 [email protected] [google_sign_in] Implement
`disconnect` for Android (flutter/packages#9991)
2025-09-24 [email protected] [camera_android]
Remove references to third party `googlesamples/mlkit` code
(flutter/packages#10056)
2025-09-23 [email protected]
[go_router_builder] [in_app_purchase_storekit] Removes redundant
arguments from annotations (flutter/packages#9964)
2025-09-23 [email protected] [go_router] Fix
Android Cold Start deep link with empty path losing scheme and
authority. (flutter/packages#9868)
2025-09-23 [email protected] [go_router_builder] Proposal: add json
support, custom string encoder/decoder (flutter/packages#8665)
2025-09-23 [email protected] [go_router] Fix ShellRoutes break iOS
swipe back navigation (flutter/packages#9968)

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
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
…r#175935)

flutter/packages@3413b65...117bf63

2025-09-24 [email protected] [ci] Add update-release-info command
suggestion when version check fails (flutter/packages#9834)
2025-09-24 [email protected] Manual roll Flutter from
9ff2767 to 4a04204 (28 revisions) (flutter/packages#10067)
2025-09-24 [email protected] Remove "All right reserved" from all
files (flutter/packages#10066)
2025-09-24 [email protected] [google_sign_in] Implement
`disconnect` for Android (flutter/packages#9991)
2025-09-24 [email protected] [camera_android]
Remove references to third party `googlesamples/mlkit` code
(flutter/packages#10056)
2025-09-23 [email protected]
[go_router_builder] [in_app_purchase_storekit] Removes redundant
arguments from annotations (flutter/packages#9964)
2025-09-23 [email protected] [go_router] Fix
Android Cold Start deep link with empty path losing scheme and
authority. (flutter/packages#9868)
2025-09-23 [email protected] [go_router_builder] Proposal: add json
support, custom string encoder/decoder (flutter/packages#8665)
2025-09-23 [email protected] [go_router] Fix ShellRoutes break iOS
swipe back navigation (flutter/packages#9968)

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
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 override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: go_router_builder p: in_app_purchase platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants