From 06969c249137d0727f379e660bfc4a2a4904871a Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Sun, 11 Nov 2018 03:42:28 -0800 Subject: [PATCH] Document not passing empty-strings into Locale (flutter/engine#6818) --- engine/src/flutter/lib/ui/window.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/lib/ui/window.dart b/engine/src/flutter/lib/ui/window.dart index c6d5a754f6..76ef10a932 100644 --- a/engine/src/flutter/lib/ui/window.dart +++ b/engine/src/flutter/lib/ui/window.dart @@ -135,7 +135,8 @@ class WindowPadding { /// [Locale]. class Locale { /// Creates a new Locale object. The first argument is the - /// primary language subtag, the second is the region subtag. + /// primary language subtag, the second is the region (also + /// referred to as 'country') subtag. /// /// For example: /// @@ -145,7 +146,8 @@ class Locale { /// ``` /// /// The primary language subtag must not be null. The region subtag is - /// optional. + /// optional. When there is no region/country subtag, the parameter should + /// be omitted or passed `null` instead of an empty-string. /// /// The subtag values are _case sensitive_ and must be one of the valid /// subtags according to CLDR supplemental data: @@ -182,6 +184,9 @@ class Locale { /// [region](http://unicode.org/cldr/latest/common/validity/region.xml) for /// each of languageCode, scriptCode and countryCode respectively. /// + /// The [countryCode] subtag is optional. When there is no country subtag, + /// the parameter should be omitted or passed `null` instead of an empty-string. + /// /// Validity is not checked by default, but some methods may throw away /// invalid data. const Locale.fromSubtags({