title: Invalid argument(s): Invalid locale "en_US"
body: <p>I successfully created my newly supported language which is 'rw' (Rwandan language), and you can change the state of language but every time I restart the app while in my language('rw') state, I get the following error, does anyone know how to resolve this issue?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>The following ArgumentError was thrown building:
  Invalid argument(s): Invalid locale "en_US"
  
  When the exception was thrown, this was the stack
  #0      _throwLocaleError
  package:intl/src/intl_helpers.dart:177
  #1      verifiedLocale
  package:intl/src/intl_helpers.dart:171
  #2      verifiedLocale
  package:intl/src/intl_helpers.dart:156
  #3      new DateFormat
  package:intl/…/intl/date_format.dart:266
  #4      new DateFormat.yMEd
  package:intl/…/intl/date_format.dart:478</code></pre>
  </div>
  </div>
  </p>
  <p>Here is my rw_intl.dart file</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import 'dart:async';
  
  import 'package:intl/intl.dart' as intl;
  import 'package:intl/date_symbols.dart' as intl;
  import 'package:intl/date_symbol_data_custom.dart' as date_symbol_data_custom;
  import 'package:flutter/foundation.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter_localizations/flutter_localizations.dart';
  
  /// A custom set of date patterns for the `rw` locale.
  ///
  /// These are not accurate and are just a clone of the date patterns for the
  /// `no` locale to demonstrate how one would write and use custom date patterns.
  const rwLocaleDatePatterns = {
    'd': 'd.',
    'E': 'ccc',
    'EEEE': 'cccc',
    'LLL': 'LLL',
    'LLLL': 'LLLL',
    'M': 'L.',
    'Md': 'd.M.',
    'MEd': 'EEE d.M.',
    'MMM': 'LLL',
    'MMMd': 'd. MMM',
    'MMMEd': 'EEE d. MMM',
    'MMMM': 'LLLL',
    'MMMMd': 'd. MMMM',
    'MMMMEEEEd': 'EEEE d. MMMM',
    'QQQ': 'QQQ',
    'QQQQ': 'QQQQ',
    'y': 'y',
    'yM': 'M.y',
    'yMd': 'd.M.y',
    'yMEd': 'EEE d.MM.y',
    'yMMM': 'MMM y',
    'yMMMd': 'd. MMM y',
    'yMMMEd': 'EEE d. MMM y',
    'yMMMM': 'MMMM y',
    'yMMMMd': 'd. MMMM y',
    'yMMMMEEEEd': 'EEEE d. MMMM y',
    'yQQQ': 'QQQ y',
    'yQQQQ': 'QQQQ y',
    'H': 'HH',
    'Hm': 'HH:mm',
    'Hms': 'HH:mm:ss',
    'j': 'HH',
    'jm': 'HH:mm',
    'jms': 'HH:mm:ss',
    'jmv': 'HH:mm v',
    'jmz': 'HH:mm z',
    'jz': 'HH z',
    'm': 'm',
    'ms': 'mm:ss',
    's': 's',
    'v': 'v',
    'z': 'z',
    'zzzz': 'zzzz',
    'ZZZZ': 'ZZZZ',
  };
  
  /// A custom set of date symbols for the `rw` locale.
  ///
  /// These are not accurate and are just a clone of the date symbols for the
  /// `no` locale to demonstrate how one would write and use custom date symbols.
  const rwDateSymbols = {
    'NAME': 'rw',
    'ERAS': &lt;dynamic&gt;[
      'm.Kr.',
      'n.Kr.',
    ],
    'ERANAMES': &lt;dynamic&gt;[
      'mbere ya Kristu',
      'nyuma ya Kristu',
    ],
    'NARROWMONTHS': &lt;dynamic&gt;[
      'M',
      'G',
      'W',
      'M',
      'G',
      'K',
      'N',
      'K',
      'N',
      'U',
      'U',
      'U',
    ],
    'STANDALONENARROWMONTHS': &lt;dynamic&gt;[
      'M',
      'G',
      'W',
      'M',
      'G',
      'K',
      'N',
      'K',
      'N',
      'U',
      'U',
      'U',
    ],
    'MONTHS': &lt;dynamic&gt;[
      'Mutarama',
      'Gashyantare',
      'Werurwe',
      'Mata',
      'Gicurasi',
      'Kamena',
      'Nyakanga',
      'Kanama',
      'Nzeli',
      'Ukwakira',
      'Ugushyingo',
      'Ukuboza',
    ],
    'STANDALONEMONTHS': &lt;dynamic&gt;[
      'Mutarama',
      'Gashyantare',
      'Werurwe',
      'Mata',
      'Gicurasi',
      'Kamena',
      'Nyakanga',
      'Kanama',
      'Nzeli',
      'Ukwakira',
      'Ugushyingo',
      'Ukuboza',
    ],
    'SHORTMONTHS': &lt;dynamic&gt;[
      'Mut.',
      'Gas.',
      'Wer.',
      'Mat.',
      'Gic.',
      'Kam.',
      'Nya.',
      'Kan.',
      'Nze.',
      'Ukw.',
      'Ugu.',
      'Uku.',
    ],
    'STANDALONESHORTMONTHS': &lt;dynamic&gt;[
      'Mut.',
      'Gas.',
      'Wer.',
      'Mat.',
      'Gic.',
      'Kam.',
      'Nya.',
      'Kan.',
      'Nze.',
      'Ukw.',
      'Ugu.',
      'Uku.',
    ],
    'WEEKDAYS': &lt;dynamic&gt;[
      'ku cyumweru',
      'ku wa mbere',
      'ku wa kabiri',
      'ku wa gatatu',
      'ku wa kane',
      'ku wa gatanu',
      'ku wa gatandatu',
    ],
    'STANDALONEWEEKDAYS': &lt;dynamic&gt;[
      'ku cyumweru',
      'ku wa mbere',
      'ku wa kabiri',
      'ku wa gatatu',
      'ku wa kane',
      'ku wa gatanu',
      'ku wa gatandatu',
    ],
    'SHORTWEEKDAYS': &lt;dynamic&gt;[
      'cyumwer.',
      'mbere.',
      'kabiri.',
      'gatatu.',
      'kane.',
      'gatanu.',
      'gatandat.',
    ],
    'STANDALONESHORTWEEKDAYS': &lt;dynamic&gt;[
      'cyumwer.',
      'mbere.',
      'kabiri.',
      'gatatu.',
      'kane.',
      'gatanu.',
      'gatandat.',
    ],
    'NARROWWEEKDAYS': &lt;dynamic&gt;[
      'C',
      'M',
      'K',
      'G',
      'K',
      'G',
      'G',
    ],
    'STANDALONENARROWWEEKDAYS': &lt;dynamic&gt;[
      'C',
      'M',
      'K',
      'G',
      'K',
      'G',
      'G',
    ],
    'SHORTQUARTERS': &lt;dynamic&gt;[
      'K1',
      'K2',
      'K3',
      'K4',
    ],
    'QUARTERS': &lt;dynamic&gt;[
      'kimwe cya kane',
      'bibiri bya kane',
      'bitatu bya kane',
      'bine bya kane',
    ],
    'AMPMS': &lt;dynamic&gt;[
      'za mu gitondo',
      'z\' umugoroba ',
    ],
    'DATEFORMATS': &lt;dynamic&gt;[
      'EEEE d. MMMM y',
      'd. MMMM y',
      'd. MMM y',
      'dd.MM.y',
    ],
    'TIMEFORMATS': &lt;dynamic&gt;[
      'HH:mm:ss zzzz',
      'HH:mm:ss z',
      'HH:mm:ss',
      'HH:mm',
    ],
    'AVAILABLEFORMATS': null,
    'FIRSTDAYOFWEEK': 0,
    'WEEKENDRANGE': &lt;dynamic&gt;[
      5,
      6,
    ],
    'FIRSTWEEKCUTOFFDAY': 3,
    'DATETIMEFORMATS': &lt;dynamic&gt;[
      '{1} {0}',
      '{1} \'kl\'. {0}',
      '{1}, {0}',
      '{1}, {0}',
    ],
  };
  
  class _RwMaterialLocalizationsDelegate
      extends LocalizationsDelegate&lt;MaterialLocalizations&gt; {
    const _RwMaterialLocalizationsDelegate();
  
    @override
    bool isSupported(Locale locale) =&gt; locale.languageCode == 'rw';
  
    @override
    Future&lt;MaterialLocalizations&gt; load(Locale locale) async {
      final String localeName = intl.Intl.canonicalizedLocale(locale.toString());
  
      // The locale (in this case `rw`) needs to be initialized into the custom
      // date symbols and patterns setup that Flutter uses.
      date_symbol_data_custom.initializeDateFormattingCustom(
        locale: localeName,
        patterns: rwLocaleDatePatterns,
        symbols: intl.DateSymbols.deserializeFromMap(rwDateSymbols),
      );
  
      return SynchronousFuture&lt;MaterialLocalizations&gt;(
        RwMaterialLocalizations(
          localeName: localeName,
          // The `intl` library's NumberFormat class is generated from CLDR data
          // (see https://github.com/dart-lang/intl/blob/master/lib/number_symbols_data.dart).
          // Unfortunately, there is no way to use a locale that isn't defined in
          // this map and the only way to work around this is to use a listed
          // locale's NumberFormat symbols. So, here we use the number formats
          // for 'en_US' instead.
          decimalFormat: intl.NumberFormat('#,##0.###', 'en_US'),
          twoDigitZeroPaddedFormat: intl.NumberFormat('00', 'en_US'),
          // DateFormat here will use the symbols and patterns provided in the
          // `date_symbol_data_custom.initializeDateFormattingCustom` call above.
          // However, an alternative is to simply use a supported locale's
          // DateFormat symbols, similar to NumberFormat above.
          fullYearFormat: intl.DateFormat('y', localeName),
          compactDateFormat: intl.DateFormat('yMd', localeName),
          shortDateFormat: intl.DateFormat('yMMMd', localeName),
          mediumDateFormat: intl.DateFormat('EEE, MMM d', localeName),
          longDateFormat: intl.DateFormat('EEEE, MMMM d, y', localeName),
          yearMonthFormat: intl.DateFormat('MMMM y', localeName),
          shortMonthDayFormat: intl.DateFormat('MMM d', localeName),
        ),
      );
    }
  
    @override
    bool shouldReload(_RwMaterialLocalizationsDelegate old) =&gt; false;
  }
  
  /// A custom set of localizations for the 'rw' locale. In this example, only
  /// the value for openAppDrawerTooltip was modified to use a custom message as
  /// an example. Everything else uses the American English (en_US) messages
  /// and formatting.
  class RwMaterialLocalizations extends GlobalMaterialLocalizations {
    const RwMaterialLocalizations({
      String localeName = 'rw',
      @required intl.DateFormat fullYearFormat,
      @required intl.DateFormat compactDateFormat,
      @required intl.DateFormat shortDateFormat,
      @required intl.DateFormat mediumDateFormat,
      @required intl.DateFormat longDateFormat,
      @required intl.DateFormat yearMonthFormat,
      @required intl.DateFormat shortMonthDayFormat,
      @required intl.NumberFormat decimalFormat,
      @required intl.NumberFormat twoDigitZeroPaddedFormat,
    }) : super(
            localeName: localeName,
            fullYearFormat: fullYearFormat,
            compactDateFormat: compactDateFormat,
            shortDateFormat: shortDateFormat,
            mediumDateFormat: mediumDateFormat,
            longDateFormat: longDateFormat,
            yearMonthFormat: yearMonthFormat,
            shortMonthDayFormat: shortMonthDayFormat,
            decimalFormat: decimalFormat,
            twoDigitZeroPaddedFormat: twoDigitZeroPaddedFormat,
          );
  
    @override
    String get moreButtonTooltip =&gt; r'Ibindi';
  
    @override
    String get aboutListTileTitleRaw =&gt; r'Ibijyanye $applicationName';
  
    @override
    String get alertDialogLabel =&gt; r'Imenyesha';
  
    @override
    String get anteMeridiemAbbreviation =&gt; r'AM';
  
    @override
    String get backButtonTooltip =&gt; r'Inyuma';
  
    @override
    String get cancelButtonLabel =&gt; r'HAGARIKA';
  
    @override
    String get closeButtonLabel =&gt; r'FUNGA';
  
    @override
    String get closeButtonTooltip =&gt; r'Funga';
  
    @override
    String get collapsedIconTapHint =&gt; r'Agura';
  
    @override
    String get continueButtonLabel =&gt; r'KOMEZA';
  
    @override
    String get copyButtonLabel =&gt; r'KOPIYA';
  
    @override
    String get cutButtonLabel =&gt; r'KATINGA';
  
    @override
    String get deleteButtonTooltip =&gt; r'Siba';
  
    @override
    String get dialogLabel =&gt; r'Ikiganiro';
  
    @override
    String get drawerLabel =&gt; r'Ibikubiyemo';
  
    @override
    String get expandedIconTapHint =&gt; r'Gabanya';
  
    @override
    String get hideAccountsLabel =&gt; r'Hishya konte';
  
    @override
    String get licensesPageTitle =&gt; r'Licenses';
  
    @override
    String get modalBarrierDismissLabel =&gt; r'Dismiss';
  
    @override
    String get nextMonthTooltip =&gt; r'Ukwezi gutaha';
  
    @override
    String get nextPageTooltip =&gt; r'Paji ikurikira';
  
    @override
    String get okButtonLabel =&gt; r'KOMEZA';
  
    @override
    // A custom drawer tooltip message.
    String get openAppDrawerTooltip =&gt; r'Custom Navigation Menu Tooltip';
  
    @override
    String get pageRowsInfoTitleRaw =&gt; r'$firstRow–$lastRow of $rowCount';
  
    @override
    String get pageRowsInfoTitleApproximateRaw =&gt;
        r'$firstRow–$lastRow of about $rowCount';
  
    @override
    String get pasteButtonLabel =&gt; r'PASTE';
  
    @override
    String get popupMenuLabel =&gt; r'Popup menu';
  
    @override
    String get postMeridiemAbbreviation =&gt; r'PM';
  
    @override
    String get previousMonthTooltip =&gt; r'Ukwezi gushize';
  
    @override
    String get previousPageTooltip =&gt; r'Paji ibanza';
  
    @override
    String get refreshIndicatorSemanticLabel =&gt; r'Refresh';
  
    @override
    String get remainingTextFieldCharacterCountFew =&gt; null;
  
    @override
    String get remainingTextFieldCharacterCountMany =&gt; null;
  
    @override
    String get remainingTextFieldCharacterCountOne =&gt; r'inyuguti imwe isigaye';
  
    @override
    String get remainingTextFieldCharacterCountOther =&gt;
        r'inyuguti $remainingCount zisigaye';
  
    @override
    String get remainingTextFieldCharacterCountTwo =&gt; null;
  
    @override
    String get remainingTextFieldCharacterCountZero =&gt; r'Nta nyuguti isigaye';
  
    @override
    String get reorderItemDown =&gt; r'Manuka';
  
    @override
    String get reorderItemLeft =&gt; r'Jya ibumoso';
  
    @override
    String get reorderItemRight =&gt; r'Jya iburyo';
  
    @override
    String get reorderItemToEnd =&gt; r'Manuka ahahera';
  
    @override
    String get reorderItemToStart =&gt; r'Zamuka ahabanza';
  
    @override
    String get reorderItemUp =&gt; r'Zamuka';
  
    @override
    String get rowsPerPageTitle =&gt; r'Rows per page:';
  
    @override
    ScriptCategory get scriptCategory =&gt; ScriptCategory.englishLike;
  
    @override
    String get searchFieldLabel =&gt; r'Ishakiro';
  
    @override
    String get selectAllButtonLabel =&gt; r'HITAMO BYOSE';
  
    @override
    String get selectedRowCountTitleFew =&gt; null;
  
    @override
    String get selectedRowCountTitleMany =&gt; null;
  
    @override
    String get selectedRowCountTitleOne =&gt; r'1 item selected';
  
    @override
    String get selectedRowCountTitleOther =&gt; r'$selectedRowCount items selected';
  
    @override
    String get selectedRowCountTitleTwo =&gt; null;
  
    @override
    String get selectedRowCountTitleZero =&gt; r'No items selected';
  
    @override
    String get showAccountsLabel =&gt; r'Garagaza konte';
  
    @override
    String get showMenuTooltip =&gt; r'Garagaza Ibikubiyemo';
  
    @override
    String get signedInLabel =&gt; r'Winjiye';
  
    @override
    String get tabLabelRaw =&gt; r'Tab $tabIndex of $tabCount';
  
    @override
    TimeOfDayFormat get timeOfDayFormatRaw =&gt; TimeOfDayFormat.h_colon_mm_space_a;
  
    @override
    String get timePickerHourModeAnnouncement =&gt; r'Hitamo amasaha';
  
    @override
    String get timePickerMinuteModeAnnouncement =&gt; r'Hitamo iminota';
  
    @override
    String get viewLicensesButtonLabel =&gt; r'VIEW LICENSES';
  
    @override
    List&lt;String&gt; get narrowWeekdays =&gt;
        const &lt;String&gt;['C', 'M', 'K', 'G', 'K', 'G', 'G'];
  
    @override
    int get firstDayOfWeekIndex =&gt; 0;
  
    static const LocalizationsDelegate&lt;MaterialLocalizations&gt; delegate =
        _RwMaterialLocalizationsDelegate();
  
    @override
    String get calendarModeButtonLabel =&gt; r'Jya kuri kalendari';
  
    @override
    String get dateHelpText =&gt; r'mm/dd/yyyy';
  
    @override
    String get dateInputLabel =&gt; r'Injiza itariki';
  
    @override
    String get dateOutOfRangeLabel =&gt; r'Out of range.';
  
    @override
    String get datePickerHelpText =&gt; r'HITAMO ITARIKI';
  
    @override
    String get dateRangeEndDateSemanticLabelRaw =&gt; r'Itariki ihera $fullDate';
  
    @override
    String get dateRangeEndLabel =&gt; r'Itariki ihera';
  
    @override
    String get dateRangePickerHelpText =&gt; 'HITAMO INTERA';
  
    @override
    String get dateRangeStartDateSemanticLabelRaw =&gt; 'Itariki ibanza \$fullDate';
  
    @override
    String get dateRangeStartLabel =&gt; 'Itariki ibanza';
  
    @override
    String get dateSeparator =&gt; '/';
  
    @override
    String get dialModeButtonLabel =&gt; 'Switch to dial picker mode';
  
    @override
    String get inputDateModeButtonLabel =&gt; 'Switch to input';
  
    @override
    String get inputTimeModeButtonLabel =&gt; 'Switch to text input mode';
  
    @override
    String get invalidDateFormatLabel =&gt; 'Invalid format.';
  
    @override
    String get invalidDateRangeLabel =&gt; 'Invalid range.';
  
    @override
    String get invalidTimeLabel =&gt; 'Enter a valid time';
  
    @override
    String get licensesPackageDetailTextOther =&gt; '\$licenseCount licenses';
  
    @override
    String get saveButtonLabel =&gt; 'BIKA';
  
    @override
    String get selectYearSemanticsLabel =&gt; 'Hitamo umwaka';
  
    @override
    String get timePickerDialHelpText =&gt; 'HITAMO IGIHE';
  
    @override
    String get timePickerHourLabel =&gt; 'Isaha';
  
    @override
    String get timePickerInputHelpText =&gt; 'INJIZA GIHE';
  
    @override
    String get timePickerMinuteLabel =&gt; 'Umunota';
  
    @override
    String get unspecifiedDate =&gt; 'Itariki';
  
    @override
    String get unspecifiedDateRange =&gt; 'Date Range';
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Here is my main.dart file</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>`locale: _locale,
  supportedLocales: [
  Locale('en'),
  Locale('rw'),
  ],
  localizationsDelegates: [
  DemoLocalization.delegate,
  GlobalMaterialLocalizations.delegate,
  GlobalWidgetsLocalizations.delegate,
  GlobalCupertinoLocalizations.delegate,
  RwMaterialLocalizations.delegate,
  ],
  
          localeResolutionCallback: (deviceLocale, supportedLocales) {
            for (var locale in supportedLocales) {
              if (locale.languageCode == deviceLocale.languageCode) {
                return deviceLocale;
              }
            }
            return supportedLocales.first;
          },`</code></pre>
  </div>
  </div>
  </p>