mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Added language to appearance model
This commit is contained in:
parent
95247bc5fb
commit
8e14f8b9f1
@ -12,7 +12,7 @@ class AppearanceSettingModel extends ChangeNotifier with EquatableMixin {
|
||||
|
||||
AppearanceSettingModel(this.setting)
|
||||
: _theme = AppTheme.fromName(name: setting.theme),
|
||||
_language = AppLanguage.fromName(name: setting.language);
|
||||
_language = languageFromString(setting.language);
|
||||
|
||||
AppTheme get theme => _theme;
|
||||
AppLanguage get language => _language;
|
||||
@ -37,12 +37,13 @@ class AppearanceSettingModel extends ChangeNotifier with EquatableMixin {
|
||||
}
|
||||
}
|
||||
|
||||
void setLanguage(Language language) {
|
||||
String langaugeString = stringFromLanguageName(language);
|
||||
void setLanguage(AppLanguage language) {
|
||||
String languageString = stringFromLanguageName(language);
|
||||
|
||||
if (setting.language != langaugeString) {
|
||||
_language = AppLanguage.fromLanguage(language: language);
|
||||
setting.language = langaugeString;
|
||||
if (setting.language != languageString) {
|
||||
_language = language;
|
||||
print('language changed to $languageString');
|
||||
setting.language = languageString;
|
||||
notifyListeners();
|
||||
save();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user