Skip to content

Conversation

@Abhishek01039
Copy link
Contributor

part of #84014

@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 on the #hackers channel in Chat.

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.

@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jun 6, 2021
@google-cla google-cla bot added the cla: yes label Jun 6, 2021
@Piinks Piinks added a: null-safety Support for Dart's null safety feature c: tech-debt Technical debt, code quality, testing, etc. labels Jun 9, 2021
@Abhishek01039 Abhishek01039 requested a review from goderbauer June 10, 2021 17:18
@darrenaustin darrenaustin self-requested a review June 10, 2021 18:48
Copy link
Contributor

@darrenaustin darrenaustin left a comment

Choose a reason for hiding this comment

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

@Abhishek01039 thanks so much for the contribution. I have a few comments that need to be addressed before we can land this.


final Set<String> keys = Set<String>.from(
resources.keys.where((String key) => !isPluralVariation(key))
resources!.keys.where((String key) => !isPluralVariation(key))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what @goderbauer was getting at is that here (line 125) we are assuming that resources is not null. If that is always the case then we should make resources non-nullable. If it can be null then the initialization for keys here needs to take that into account. Given that the existing code works with keys being initialized as they are I think we can assume it is not null.

final List<String> missingKeys = <String>[];
for (final String missingKey in canonicalKeys.difference(keys)) {
final dynamic attribute = attributes[missingKey];
for (final String? missingKey in canonicalKeys.difference(keys)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If canonicalKeys is defined as Set<String> as mentioned above, then neither missingKeys or missingKey here would need to use nullable strings here.

Copy link
Contributor

@darrenaustin darrenaustin left a comment

Choose a reason for hiding this comment

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

Thanks for the update, but it looks like you missed the resources being non-null in localizations_validator.dart. Please update that and I think we will be good to go. Thx.

Copy link
Contributor

@darrenaustin darrenaustin left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@darrenaustin darrenaustin merged commit 4705e0c into flutter:master Jun 14, 2021
@Abhishek01039 Abhishek01039 deleted the migrate_localization_new branch June 15, 2021 02:38
@Abhishek01039
Copy link
Contributor Author

Thanks @darrenaustin

@jmagman jmagman mentioned this pull request Jul 13, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: null-safety Support for Dart's null safety feature c: contributor-productivity Team-specific productivity, code health, technical debt. c: tech-debt Technical debt, code quality, testing, etc. f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants