From ada593e8f776f2b161803953841563610fe25507 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Fri, 29 Sep 2017 15:16:21 -0700 Subject: [PATCH] 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. --- packages/flutter/lib/src/material/material_localizations.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/material/material_localizations.dart b/packages/flutter/lib/src/material/material_localizations.dart index fc6041c6da..000cc46e54 100644 --- a/packages/flutter/lib/src/material/material_localizations.dart +++ b/packages/flutter/lib/src/material/material_localizations.dart @@ -146,8 +146,8 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { /// [LocalizationsDelegate] implementations typically call the static [load] /// function, rather than constructing this class directly. DefaultMaterialLocalizations(this.locale) - : assert(locale != null), - this._localeName = _computeLocaleName(locale) { + : this._localeName = _computeLocaleName(locale) { + assert(locale != null); if (localizations.containsKey(locale.languageCode)) _nameToValue.addAll(localizations[locale.languageCode]); if (localizations.containsKey(_localeName))