From 1c3903c8e7d829c8d51681d1fbc61280b77cfe7f Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Fri, 19 Oct 2018 23:44:40 -0700 Subject: [PATCH] Revert "Pass null instead of 'none' locale" (flutter/engine#6622) * Revert "Revert "Roll buildtools to 759274dd801b2f78ae0c4066101d0beca27ffc9a" (#6621)" This reverts commit 12d4f7678b3522f649dfdef4f2403a279a706a80. * Revert "Properly gate android API < 21 and remove extraneous data array. (#6619)" This reverts commit 863ab7c18b5a26445865140b37a59ea3b7411238. * Revert "Update Dart version in Dockerfile (#6618)" This reverts commit 2b64ec9248bcf2f7d7e9d40b4fd6ee19e06d200e. * Revert "Don't attempt to build any platform target on Fuchsia. (#6617)" This reverts commit 1ce76760ae843c889b8d4c51f0fb53102888bf20. * Revert "Roll Dart to 45f9462398ae7d2e80acd79d3f9c32c7ca6f6f97 (#6616)" This reverts commit 4b7e5ce784ee037b8bb253447bb16ab80e121824. * Revert "Pass null instead of 'none' locale (#6613)" This reverts commit 9ae28b334fd3c85ee276fa6ee0eeac5824dc62d2. --- engine/src/flutter/lib/ui/window.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/window.dart b/engine/src/flutter/lib/ui/window.dart index ca93f4874b..2c4f283214 100644 --- a/engine/src/flutter/lib/ui/window.dart +++ b/engine/src/flutter/lib/ui/window.dart @@ -152,6 +152,9 @@ class Locale { /// 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('', ''); + /// The primary language subtag for the locale. /// /// This must not be null. @@ -440,7 +443,7 @@ class Window { if (_locales != null && _locales.isNotEmpty) { return _locales.first; } - return null; + return Locale.none; } /// The full system-reported supported locales of the device.