This commit is contained in:
Alessandro Autiero
2024-05-20 17:24:00 +02:00
parent 7c2caed16c
commit 9f5590d41c
562 changed files with 3303 additions and 156787 deletions

View File

@@ -39,14 +39,9 @@ class GameController extends GetxController {
customLaunchArgs.addListener(() =>
_storage.write("custom_launch_args", customLaunchArgs.text));
started = RxBool(false);
var serializedInstance = _storage.read("instance");
instance = Rxn(serializedInstance != null ? GameInstance.fromJson(jsonDecode(serializedInstance)) : null);
instance.listen((_) => saveInstance());
instance = Rxn();
}
Future<void> saveInstance() =>
_storage.write("instance", jsonEncode(instance.value?.toJson()));
void reset() {
username.text = kDefaultPlayerName;
password.text = "";