Skip to content

Add maybeLocaleOf to Localizations #68911

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

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Oct 23, 2020

Description

This removes the nullOk parameter from Localizations.localeOf, and createsLocalizations.maybeLocaleOf. Localizations.localeOfnow returns a non-nullable value, and the Localizations.maybeLocaleOf returns a nullable value.

Related Issues

Tests

  • Updated tests to use maybeOf.

Breaking Change

Sorry, something went wrong.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Oct 23, 2020
@gspencergoog gspencergoog marked this pull request as draft October 23, 2020 20:54
@google-cla google-cla bot added the cla: yes label Oct 23, 2020
@gspencergoog gspencergoog marked this pull request as ready for review October 27, 2020 22:54
@gspencergoog
Copy link
Contributor Author

This one is going to take some migration of the customer tests, since the svg package uses localeOf with nullOk set to true.

I think this will need happen in three parts: one that introduces maybeLocaleOf without changing localeOf, then a change to the svg package to use that instead of localeOf in the cases where it passes nullOk == true, making sure it never calls localeOf with a nullOk argument. Thirdly, we can remove the nullOk argument in a final change.

@gspencergoog
Copy link
Contributor Author

This change will include the first of those three changes.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@gspencergoog gspencergoog force-pushed the remove_null_ok_5 branch 2 times, most recently from 20bb8b3 to 6b66c1b Compare October 28, 2020 21:40
@gspencergoog gspencergoog changed the title Remove nullOk parameter from Localizations.localeOf and add maybeLocaleOf Add maybeLocaleOf to Localizations Oct 29, 2020
@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Windows tool_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants