findSystemLocale function Null safety
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 Future.value();
}
return Future.value(Intl.systemLocale);
}