未验证 提交 cdd592f5 编写于 作者: G Gary Qian 提交者: GitHub

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

上级 2cd89200
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册