Hide country dropdown on subsequent runs once a country is set in local storage
This commit is contained in:
@@ -22,6 +22,7 @@ class LoginController extends GetxController {
|
||||
final FlutterSecureStorage storage = const FlutterSecureStorage();
|
||||
|
||||
var selectedCountry = 'Jordan'.obs;
|
||||
bool isFirstRun = box.read(BoxName.countryCode) == null;
|
||||
|
||||
void changeCountry(String country) {
|
||||
selectedCountry.value = country;
|
||||
@@ -184,6 +185,9 @@ class LoginController extends GetxController {
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
if (box.read(BoxName.countryCode) == null) {
|
||||
await box.write(BoxName.countryCode, 'Jordan');
|
||||
}
|
||||
selectedCountry.value = box.read(BoxName.countryCode) ?? 'Jordan';
|
||||
await EncryptionHelper.initialize();
|
||||
await DeviceHelper.getDeviceFingerprint();
|
||||
|
||||
Reference in New Issue
Block a user