Move assert into constructor body. (#12331)
Temporary workaround to the fact that the Analyzer API doesn't have a way to turn on asserts in initializers, coupled with the fact that this file is being parsed by package:intl using the Analyzer API.
This commit is contained in:
parent
2698fe852e
commit
ada593e8f7
@ -146,8 +146,8 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
|
|||||||
/// [LocalizationsDelegate] implementations typically call the static [load]
|
/// [LocalizationsDelegate] implementations typically call the static [load]
|
||||||
/// function, rather than constructing this class directly.
|
/// function, rather than constructing this class directly.
|
||||||
DefaultMaterialLocalizations(this.locale)
|
DefaultMaterialLocalizations(this.locale)
|
||||||
: assert(locale != null),
|
: this._localeName = _computeLocaleName(locale) {
|
||||||
this._localeName = _computeLocaleName(locale) {
|
assert(locale != null);
|
||||||
if (localizations.containsKey(locale.languageCode))
|
if (localizations.containsKey(locale.languageCode))
|
||||||
_nameToValue.addAll(localizations[locale.languageCode]);
|
_nameToValue.addAll(localizations[locale.languageCode]);
|
||||||
if (localizations.containsKey(_localeName))
|
if (localizations.containsKey(_localeName))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user