This commit is contained in:
Hamza-Ayed
2024-02-25 00:23:00 +03:00
parent a9f557ca83
commit b33e797f76
22 changed files with 368 additions and 159 deletions

View File

@@ -298,3 +298,52 @@ class EducationDegreePicker extends StatelessWidget {
);
}
}
class CountryPicker extends StatelessWidget {
final ProfileController controller = Get.put(ProfileController());
final List<String> countryOptions = [
'Jordan'.tr,
'USA'.tr,
'Egypt'.tr,
'Turkey'.tr,
'Saudi Arabia'.tr,
'Qatar'.tr,
'Bahrain'.tr,
'Kuwait'.tr,
];
CountryPicker({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(
height: 300,
child: CupertinoPicker(
itemExtent: 32,
onSelectedItemChanged: (int index) {
controller.setCountry(countryOptions[index]);
},
children: List.generate(
countryOptions.length,
(index) => Center(
child: Text(
countryOptions[index],
style: AppStyle.title,
),
),
),
),
),
MyElevatedButton(
title: controller.selectedCountry.toString(),
onPressed: () {
box.write(
BoxName.countryCode, controller.selectedCountry.toString());
})
],
);
}
}