Commit ada593e8 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

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.
parent 2698fe85
...@@ -146,8 +146,8 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { ...@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment