Finish persistent wonderIndex feature
This commit is contained in:
parent
28734b7f1f
commit
bbab178465
@ -10,15 +10,25 @@ class SettingsLogic with ThrottledSaveLoadMixin {
|
|||||||
late final hasDismissedSearchMessage = ValueNotifier<bool>(false)..addListener(scheduleSave);
|
late final hasDismissedSearchMessage = ValueNotifier<bool>(false)..addListener(scheduleSave);
|
||||||
late final isSearchPanelOpen = ValueNotifier<bool>(true)..addListener(scheduleSave);
|
late final isSearchPanelOpen = ValueNotifier<bool>(true)..addListener(scheduleSave);
|
||||||
late final currentLocale = ValueNotifier<String?>(null)..addListener(scheduleSave);
|
late final currentLocale = ValueNotifier<String?>(null)..addListener(scheduleSave);
|
||||||
|
late final prevWonderIndex = ValueNotifier<int?>(null)..addListener(scheduleSave);
|
||||||
|
|
||||||
final bool useBlurs = !PlatformInfo.isAndroid;
|
final bool useBlurs = !PlatformInfo.isAndroid;
|
||||||
|
|
||||||
|
Future<void> changeLocale(Locale value) async {
|
||||||
|
currentLocale.value = value.languageCode;
|
||||||
|
await localeLogic.loadIfChanged(value);
|
||||||
|
// Re-init controllers that have some cached data that is localized
|
||||||
|
wondersLogic.init();
|
||||||
|
timelineLogic.init();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void copyFromJson(Map<String, dynamic> value) {
|
void copyFromJson(Map<String, dynamic> value) {
|
||||||
hasCompletedOnboarding.value = value['hasCompletedOnboarding'] ?? false;
|
hasCompletedOnboarding.value = value['hasCompletedOnboarding'] ?? false;
|
||||||
hasDismissedSearchMessage.value = value['hasDismissedSearchMessage'] ?? false;
|
hasDismissedSearchMessage.value = value['hasDismissedSearchMessage'] ?? false;
|
||||||
currentLocale.value = value['currentLocale'];
|
currentLocale.value = value['currentLocale'];
|
||||||
isSearchPanelOpen.value = value['isSearchPanelOpen'] ?? false;
|
isSearchPanelOpen.value = value['isSearchPanelOpen'] ?? false;
|
||||||
|
prevWonderIndex.value = value['lastWonderIndex'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -28,14 +38,7 @@ class SettingsLogic with ThrottledSaveLoadMixin {
|
|||||||
'hasDismissedSearchMessage': hasDismissedSearchMessage.value,
|
'hasDismissedSearchMessage': hasDismissedSearchMessage.value,
|
||||||
'currentLocale': currentLocale.value,
|
'currentLocale': currentLocale.value,
|
||||||
'isSearchPanelOpen': isSearchPanelOpen.value,
|
'isSearchPanelOpen': isSearchPanelOpen.value,
|
||||||
|
'lastWonderIndex': prevWonderIndex.value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> changeLocale(Locale value) async {
|
|
||||||
currentLocale.value = value.languageCode;
|
|
||||||
await localeLogic.loadIfChanged(value);
|
|
||||||
// Re-init controllers that have some cached data that is localized
|
|
||||||
wondersLogic.init();
|
|
||||||
timelineLogic.init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user