mirror of
https://github.com/gskinnerTeam/flutter-wonderous-app.git
synced 2025-06-22 04:09:51 +08:00
add setLocale method on settings
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user