-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[various] Scrub pre-iOS-13 code #9849
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
base: main
Are you sure you want to change the base?
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.
Code Review
This pull request effectively removes support for iOS versions older than 13.0 across several packages, which simplifies the codebase by removing conditional logic and updating deployment targets. The changes are well-executed and include valuable refactoring in in_app_purchase_storekit
to improve code clarity and performance by using dictionary literals and pre-allocating array capacities. I've found one minor inconsistency in the test stubs related to array initialization that could be addressed for better consistency with the rest of the changes.
} | ||
|
||
[self setValue:discounts forKey:@"discounts"]; | ||
NSMutableArray *discounts = [[NSMutableArray alloc] init]; |
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.
For consistency with the other changes in this PR, it would be better to initialize this mutable array with a specific capacity, since the size is known. You've done this in FIAObjectTranslator.m
, and applying the same pattern here would be a nice touch.
NSMutableArray *discounts = [[NSMutableArray alloc] init]; | |
NSMutableArray *discounts = [NSMutableArray arrayWithCapacity:[map[@"discounts"] count]]; |
This comment was marked as resolved.
This comment was marked as resolved.
This is actually ready for review now; apologies for not marking it as a draft when I first posted it. |
For all packages that had conditionals to support iOS <13:
There is also some minor cleanup in
in_app_purchase_storekit
; just removing conditionals would have left cases where we were unnecessarily constructing dictionaries dynamically, so I folded them into the initial dictionary construction, and while doing that I noticed some cases where we were doing other unnecessary dynamic construction (maybe due to previous OS conditionals?) so I updated those as well. And then I noticed some inconsistency in use ofWithCapacity:
and updated those cases to be consistent. Lastly, I fixed a few stale comments that didn't reflect the current state of the code.Includes autoformat changes, since updating the min Dart SDK opts into some formatter changes.
Fixes flutter/flutter#167735
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.///
).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
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