Hide country dropdown on subsequent runs once a country is set in local storage

This commit is contained in:
Hamza-Ayed
2026-06-29 00:45:47 +03:00
parent c4fd859257
commit b5e2bf2fed
4 changed files with 89 additions and 79 deletions

View File

@@ -24,6 +24,7 @@ class OtpHelper extends GetxController {
'${AppLink.server}/Admin/auth/login.php';
var selectedCountry = 'Jordan'.obs;
bool isFirstRun = box.read(BoxName.countryCode) == null;
void changeCountry(String country) {
selectedCountry.value = country;
@@ -288,6 +289,9 @@ class OtpHelper extends GetxController {
@override
void onInit() {
if (box.read(BoxName.countryCode) == null) {
box.write(BoxName.countryCode, 'Jordan');
}
selectedCountry.value = box.read(BoxName.countryCode) ?? 'Jordan';
super.onInit();
DeviceHelper.getDeviceFingerprint().then((deviceFingerprint) {