findSystemLocale function

Future<String> findSystemLocale ()

Find the system locale, accessed via the appropriate system APIs, and set it as the default for internationalization operations in the Intl.systemLocale variable.

Implementation

Future<String> findSystemLocale() {
  try {
    Intl.systemLocale = Intl.canonicalizedLocale(Platform.localeName);
  } catch (e) {
    return new Future.value();
  }
  return new Future.value(Intl.systemLocale);
}