setDefaultLocale static method

void setDefaultLocale(
  1. String locale
)

Sets the default locale. By default it is en.

Example:

setDefaultLocale('hi');

Implementation

static void setDefaultLocale(String locale) {
  assert(
    _messageMap.containsKey(locale),
    '[locale] must be a valid locale',
  );
  _defaultLocale = locale;
}