Remove currentWonder persistence, no longer necessary since app no longer restarts when folded.
This commit is contained in:
parent
8050060b7e
commit
ead7c75beb
@ -9,7 +9,6 @@ class SettingsLogic with ThrottledSaveLoadMixin {
|
||||
late final hasCompletedOnboarding = ValueNotifier<bool>(false)..addListener(scheduleSave);
|
||||
late final hasDismissedSearchMessage = ValueNotifier<bool>(false)..addListener(scheduleSave);
|
||||
late final currentLocale = ValueNotifier<String?>(null)..addListener(scheduleSave);
|
||||
late final currentWonder = ValueNotifier<int?>(null)..addListener(scheduleSave);
|
||||
|
||||
final bool useBlurs = !PlatformInfo.isAndroid;
|
||||
|
||||
@ -18,7 +17,6 @@ class SettingsLogic with ThrottledSaveLoadMixin {
|
||||
hasCompletedOnboarding.value = value['hasCompletedOnboarding'] ?? false;
|
||||
hasDismissedSearchMessage.value = value['hasDismissedSearchMessage'] ?? false;
|
||||
currentLocale.value = value['currentLocale'];
|
||||
currentWonder.value = value['currentWonder'];
|
||||
}
|
||||
|
||||
@override
|
||||
@ -27,7 +25,6 @@ class SettingsLogic with ThrottledSaveLoadMixin {
|
||||
'hasCompletedOnboarding': hasCompletedOnboarding.value,
|
||||
'hasDismissedSearchMessage': hasDismissedSearchMessage.value,
|
||||
'currentLocale': currentLocale.value,
|
||||
'currentWonder': currentWonder.value,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -55,8 +55,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
super.initState();
|
||||
// Create page controller,
|
||||
// allow 'infinite' scrolling by starting at a very high page, or remember the previous value
|
||||
final previousWonder = settingsLogic.currentWonder.value;
|
||||
final initialPage = previousWonder ?? _numWonders * 9999;
|
||||
final initialPage = _numWonders * 9999;
|
||||
_pageController = PageController(viewportFraction: 1, initialPage: initialPage);
|
||||
_wonderIndex = initialPage % _numWonders;
|
||||
}
|
||||
@ -64,8 +63,6 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
void _handlePageChanged(value) {
|
||||
setState(() {
|
||||
_wonderIndex = value % _numWonders;
|
||||
// Save current wonder for next launch
|
||||
settingsLogic.currentWonder.value = value;
|
||||
});
|
||||
AppHaptics.lightImpact();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user