Skip to content

Commit

Permalink
Merge pull request #23 from 971586331/sy202106290414
Browse files Browse the repository at this point in the history
解决saveLocale不能保存空值问题
  • Loading branch information
xuexiangjys committed Jun 29, 2021
2 parents f88633c + 2852bdf commit cef2e22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/page/menu/language.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _LanguagePageState extends State<LanguagePage> {
children: <Widget>[
_buildLanguageItem(S.english, "en_US"),
_buildLanguageItem(S.chinese, "zh_CN"),
_buildLanguageItem(S.auto, null),
_buildLanguageItem(S.auto, "null"),
],
));
}
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ class AppTheme with ChangeNotifier {
class LocaleModel with ChangeNotifier {
// 获取当前用户的APP语言配置Locale类,如果为null,则语言跟随系统语言
Locale getLocale() {
if (_locale == null) return null;
if (_locale == "null") return null;
var t = _locale.split("_");
return Locale(t[0], t[1]);
}

String _locale;
String _locale = "null";

LocaleModel(this._locale);

Expand Down

0 comments on commit cef2e22

Please sign in to comment.