mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
#151 fix
This commit is contained in:
@@ -10,7 +10,10 @@ extension LocaleX on Locale {
|
||||
}
|
||||
|
||||
extension String2Locale on String {
|
||||
Locale get toLocale {
|
||||
Locale? get toLocale {
|
||||
if (isEmpty) {
|
||||
return null;
|
||||
}
|
||||
final parts = split('_');
|
||||
if (parts.length == 1) {
|
||||
return Locale(parts[0]);
|
||||
|
||||
Reference in New Issue
Block a user