4/16/1
This commit is contained in:
@@ -305,14 +305,14 @@ class CountryPicker extends StatelessWidget {
|
||||
final ProfileController controller = Get.put(ProfileController());
|
||||
|
||||
final List<String> countryOptions = [
|
||||
'Jordan'.tr,
|
||||
'USA'.tr,
|
||||
'Eygpt'.tr,
|
||||
'Turkey'.tr,
|
||||
'Saudi Arabia'.tr,
|
||||
'Qatar'.tr,
|
||||
'Bahrain'.tr,
|
||||
'Kuwait'.tr,
|
||||
'Jordan',
|
||||
'USA',
|
||||
'Egypt',
|
||||
'Turkey',
|
||||
'Saudi Arabia',
|
||||
'Qatar',
|
||||
'Bahrain',
|
||||
'Kuwait',
|
||||
];
|
||||
|
||||
CountryPicker({Key? key}) : super(key: key);
|
||||
@@ -341,27 +341,33 @@ class CountryPicker extends StatelessWidget {
|
||||
itemExtent: 32,
|
||||
onSelectedItemChanged: (int index) {
|
||||
controller.setCountry(countryOptions[index]);
|
||||
box.write(BoxName.countryCode,
|
||||
countryOptions[index]); // Save in English
|
||||
},
|
||||
children: List.generate(
|
||||
countryOptions.length,
|
||||
(index) => Center(
|
||||
child: Text(
|
||||
countryOptions[index],
|
||||
countryOptions[index]
|
||||
.tr, // Display translated if not English
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
MyElevatedButton(
|
||||
title: 'Select Country'.tr,
|
||||
onPressed: () {
|
||||
Get.find<LoginController>()
|
||||
.saveCountryCode(controller.selectedCountry.toString());
|
||||
box.write(
|
||||
BoxName.countryCode, controller.selectedCountry.toString());
|
||||
Get.off(LoginPage());
|
||||
})
|
||||
title: 'Select Country'.tr, // Use translated text for button
|
||||
onPressed: () {
|
||||
Get.find<LoginController>().saveCountryCode(controller
|
||||
.selectedCountry
|
||||
.toString()); // No conversion needed
|
||||
box.write(BoxName.countryCode,
|
||||
controller.selectedCountry); // Already saved in English
|
||||
Get.off(LoginPage());
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user