add setLocale method on settings
This commit is contained in:
parent
828f353d26
commit
b080a5b2e9
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:wonders/common_libs.dart';
|
||||
import 'package:wonders/logic/common/save_load_mixin.dart';
|
||||
|
||||
class SettingsLogic with ThrottledSaveLoadMixin {
|
||||
@ -24,4 +25,11 @@ class SettingsLogic with ThrottledSaveLoadMixin {
|
||||
'hasDismissedSearchMessage': hasDismissedSearchMessage.value,
|
||||
};
|
||||
}
|
||||
|
||||
Future<void> setLocale(Locale value) async {
|
||||
currentLocale.value = value.languageCode;
|
||||
await localeLogic.refreshIfChanged(value);
|
||||
wondersLogic.init();
|
||||
timelineLogic.init();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user