Reland 'Pass null instead of 'none' locale' (flutter/engine#6632)

This commit is contained in:
Gary Qian
2018-10-22 15:21:04 -07:00
committed by GitHub
parent a74ef142fe
commit 0e6caa1edc

View File

@@ -150,10 +150,7 @@ class Locale {
/// Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
/// Typically this means the primary language subtag should be lowercase and
/// the region subtag should be uppercase.
const Locale(this._languageCode, [ this._countryCode ]) : assert(_languageCode != null);
/// Empty locale constant. This is an invalid locale.
static const Locale none = const Locale('', '');
const Locale(this._languageCode, [ this._countryCode ]) : assert(_languageCode != null), assert(_languageCode != '');
/// The primary language subtag for the locale.
///
@@ -443,7 +440,7 @@ class Window {
if (_locales != null && _locales.isNotEmpty) {
return _locales.first;
}
return Locale.none;
return null;
}
/// The full system-reported supported locales of the device.