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

Follow up to #39113 #39134

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/ui/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@ class Locale {
const Locale(
this._languageCode, [
this._countryCode,
]) : assert(_languageCode != ''),
]) : assert(_languageCode.isNotEmpty),
scriptCode = null;

/// Creates a new Locale object.
Expand All @@ -1970,10 +1970,10 @@ class Locale {
String languageCode = 'und',
this.scriptCode,
String? countryCode,
}) : assert(languageCode != ''),
}) : assert(languageCode.isNotEmpty),
_languageCode = languageCode,
assert(scriptCode != ''),
assert(countryCode != ''),
assert(scriptCode == null || scriptCode.isNotEmpty),
assert(countryCode == null || countryCode.isNotEmpty),
_countryCode = countryCode;

/// The primary language subtag for the locale.
Expand Down
8 changes: 4 additions & 4 deletions lib/web_ui/lib/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,17 @@ class Locale {
const Locale(
this._languageCode, [
this._countryCode,
]) : assert(_languageCode != ''),
]) : assert(_languageCode.isNotEmpty),
scriptCode = null;

const Locale.fromSubtags({
String languageCode = 'und',
this.scriptCode,
String? countryCode,
}) : assert(languageCode != ''),
}) : assert(languageCode.isNotEmpty),
_languageCode = languageCode,
assert(scriptCode != ''),
assert(countryCode != ''),
assert(scriptCode == null || scriptCode.isNotEmpty),
assert(countryCode == null || countryCode.isNotEmpty),
_countryCode = countryCode;

String get languageCode => _deprecatedLanguageSubtagMap[_languageCode] ?? _languageCode;
Expand Down