getLocale method
Implementation
Locale? getLocale(String? locale) {
if (locale != null) {
List<String> localeList = locale.split('_');
if (localeList.length == 2) {
return Locale(localeList[0], localeList[1]);
}
}
return null;
}