2/25/1
This commit is contained in:
@@ -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());
|
||||
})
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user