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