fixed issues for release
This commit is contained in:
@ -25,6 +25,8 @@ void restoreGame() async {
|
||||
destinationController.isInRog.value = pref.getBool("is_in_rog") ?? false;
|
||||
destinationController.rogainingCounted.value =
|
||||
pref.getBool("rogaining_counted") ?? false;
|
||||
print(
|
||||
"--restored -- destinationController.isInRog.value ${pref.getBool("is_in_rog")} -- ${pref.getBool("rogaining_counted")}");
|
||||
}
|
||||
|
||||
void main() async {
|
||||
@ -61,6 +63,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (context.mounted) {
|
||||
restoreGame();
|
||||
}
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
@ -83,22 +88,22 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
Get.find<DestinationController>();
|
||||
switch (state) {
|
||||
case AppLifecycleState.resumed:
|
||||
//print("RESUMED");
|
||||
print("RESUMED");
|
||||
restoreGame();
|
||||
break;
|
||||
case AppLifecycleState.inactive:
|
||||
//print("INACTIVE");
|
||||
print("INACTIVE");
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
//print("PAUSED");
|
||||
print("PAUSED");
|
||||
saveGameState();
|
||||
break;
|
||||
case AppLifecycleState.detached:
|
||||
//print("DETACHED");
|
||||
print("DETACHED");
|
||||
saveGameState();
|
||||
break;
|
||||
case AppLifecycleState.hidden:
|
||||
//print("DETACHED");
|
||||
print("DETACHED");
|
||||
saveGameState();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user