Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Locale: empty string equates to null#17356

Merged
GaryQian merged 4 commits into
flutter-team-archive:masterfrom
GaryQian:locale
Mar 27, 2020
Merged

Locale: empty string equates to null#17356
GaryQian merged 4 commits into
flutter-team-archive:masterfrom
GaryQian:locale

Conversation

@GaryQian

Copy link
Copy Markdown
Contributor

Due to legacy support, we allow empty string as countryCode via the original constructor.

We have since added the fromSubtags constructor that added scriptCode and we no longer recommend emptyString as countryCode.

This changes it such that empty string is treated the same as null in terms of equality. This allows improved backwards compatibility and makes two functionally identical locales also compare as equal.

@GaryQian GaryQian merged commit 020d7c5 into flutter-team-archive:master Mar 27, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 27, 2020
@bdero bdero mentioned this pull request May 6, 2021
9 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants