Hide country dropdown on subsequent runs once a country is set in local storage
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user