Migrate all trivially migratable files in `package:intl`.
PiperOrigin-RevId: 327418272
diff --git a/lib/date_time_patterns.dart b/lib/date_time_patterns.dart
index ec18613..dfce6cf 100644
--- a/lib/date_time_patterns.dart
+++ b/lib/date_time_patterns.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
/// Date/time formatting symbols for a large subset of locales.
///
diff --git a/lib/number_symbols.dart b/lib/number_symbols.dart
index 8441bd0..2f5c4bf 100644
--- a/lib/number_symbols.dart
+++ b/lib/number_symbols.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
library number_symbols;
// Suppress naming issues as changes would be breaking.
@@ -30,22 +29,22 @@
DEF_CURRENCY_CODE;
const NumberSymbols(
- {this.NAME,
- this.DECIMAL_SEP,
- this.GROUP_SEP,
- this.PERCENT,
- this.ZERO_DIGIT,
- this.PLUS_SIGN,
- this.MINUS_SIGN,
- this.EXP_SYMBOL,
- this.PERMILL,
- this.INFINITY,
- this.NAN,
- this.DECIMAL_PATTERN,
- this.SCIENTIFIC_PATTERN,
- this.PERCENT_PATTERN,
- this.CURRENCY_PATTERN,
- this.DEF_CURRENCY_CODE});
+ {required this.NAME,
+ required this.DECIMAL_SEP,
+ required this.GROUP_SEP,
+ required this.PERCENT,
+ required this.ZERO_DIGIT,
+ required this.PLUS_SIGN,
+ required this.MINUS_SIGN,
+ required this.EXP_SYMBOL,
+ required this.PERMILL,
+ required this.INFINITY,
+ required this.NAN,
+ required this.DECIMAL_PATTERN,
+ required this.SCIENTIFIC_PATTERN,
+ required this.PERCENT_PATTERN,
+ required this.CURRENCY_PATTERN,
+ required this.DEF_CURRENCY_CODE});
String toString() => NAME;
}
@@ -56,10 +55,10 @@
/// number formatting pattern.)
class CompactNumberSymbols {
final Map<int, String> COMPACT_DECIMAL_SHORT_PATTERN;
- final Map<int, String> COMPACT_DECIMAL_LONG_PATTERN;
+ final Map<int, String>? COMPACT_DECIMAL_LONG_PATTERN;
final Map<int, String> COMPACT_DECIMAL_SHORT_CURRENCY_PATTERN;
CompactNumberSymbols(
- {this.COMPACT_DECIMAL_SHORT_PATTERN,
+ {required this.COMPACT_DECIMAL_SHORT_PATTERN,
this.COMPACT_DECIMAL_LONG_PATTERN,
- this.COMPACT_DECIMAL_SHORT_CURRENCY_PATTERN});
+ required this.COMPACT_DECIMAL_SHORT_CURRENCY_PATTERN});
}
diff --git a/lib/number_symbols_data.dart b/lib/number_symbols_data.dart
index 11d60eb..8536d1c 100644
--- a/lib/number_symbols_data.dart
+++ b/lib/number_symbols_data.dart
@@ -3,7 +3,6 @@
// for details. All rights reserved. Use of this source
// code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
/// Date/time formatting symbols for all locales.
///
diff --git a/lib/src/data/dates/locale_list.dart b/lib/src/data/dates/locale_list.dart
index 40bdc31..1581cca 100644
--- a/lib/src/data/dates/locale_list.dart
+++ b/lib/src/data/dates/locale_list.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this sourcecode is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
/// Hard-coded list of all available locales for dates.
final availableLocalesForDateFormatting = const [
diff --git a/lib/src/locale/locale_deprecations.dart b/lib/src/locale/locale_deprecations.dart
index 31adf3b..f43b6b7 100644
--- a/lib/src/locale/locale_deprecations.dart
+++ b/lib/src/locale/locale_deprecations.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
/// Replaces deprecated language subtags.
///
@@ -102,7 +101,7 @@
/// The subtag must already be uppercase.
///
/// TODO(b/127689510): write a new script for updating this list from CLDR data.
-String replaceDeprecatedRegionSubtag(String regionCode) {
+String? replaceDeprecatedRegionSubtag(String? regionCode) {
return _deprecatedRegionTagReplacements[regionCode] ?? regionCode;
}
diff --git a/lib/src/locale/locale_extensions.dart b/lib/src/locale/locale_extensions.dart
index e7ff25a..c04937d 100644
--- a/lib/src/locale/locale_extensions.dart
+++ b/lib/src/locale/locale_extensions.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
/// Locale extensions as defined for [Unicode Locale
/// Identifiers](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier).
@@ -15,9 +14,9 @@
/// Keys in each of the maps passed to this contructor must be syntactically
/// valid extension keys, and must already be normalized (correct case).
LocaleExtensions(
- Map<String, String> uExtensions,
- Map<String, String> tExtensions,
- Map<String, String> otherExtensions,
+ Map<String, String>? uExtensions,
+ Map<String, String>? tExtensions,
+ Map<String, String>? otherExtensions,
this._xExtensions)
: _uExtensions = _sortedUnmodifiable(uExtensions),
_tExtensions = _sortedUnmodifiable(tExtensions),
@@ -71,7 +70,7 @@
'RegExp/${_otherExtensionsValidValuesRE.pattern}. '
'Entries: ${otherExtensions.entries}.');
assert(
- _xExtensions == null || _validXExtensionsRE.hasMatch(_xExtensions),
+ _xExtensions == null || _validXExtensionsRE.hasMatch(_xExtensions!),
'_xExtensions must match RegExp/${_validXExtensionsRE.pattern}/ '
'but is "$_xExtensions".');
}
@@ -165,7 +164,7 @@
/// -x- extension values. See
/// http://www.unicode.org/reports/tr35/#pu_extensions for details.
- final String _xExtensions;
+ final String? _xExtensions;
/// List of subtags in the [Unicode Locale
/// Identifier](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier)
@@ -218,13 +217,13 @@
}
/// Creates an unmodifiable and sorted version of `unsorted`.
-Map<String, String> _sortedUnmodifiable(Map<String, String> unsorted) {
+Map<String, String> _sortedUnmodifiable(Map<String, String>? unsorted) {
if (unsorted == null) {
return const {};
}
var map = <String, String>{};
for (var key in unsorted.keys.toList()..sort()) {
- map[key] = unsorted[key];
+ map[key] = unsorted[key]!;
}
return Map.unmodifiable(map);
}