Added nullrhi option

This commit is contained in:
Alessandro Autiero
2022-09-27 22:00:31 +02:00
parent 52af8ac646
commit 908936c76c
12 changed files with 226 additions and 42 deletions

View File

@@ -36,15 +36,16 @@ class GameController extends GetxController {
_selectedVersion = Rxn(decodedSelectedVersion);
host = RxBool(_storage.read("host") ?? false);
host.listen((value) {
_storage.write("host", value);
username.text = _storage.read("${host.value ? 'host' : 'game'}_username") ?? "";
});
username = TextEditingController(text: _storage.read("${host.value ? 'host' : 'game'}_username") ?? "");
username.addListener(() async {
await _storage.write("${host.value ? 'host' : 'game'}_username", username.text);
});
host.listen((value) => _storage.write("host", value));
host.listen((value) => username.text = _storage.read("${host.value ? 'host' : 'game'}_username") ?? "");
started = RxBool(false);
}