|
|
|
|
@ -70,9 +70,45 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
|
|
|
|
|
dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"};
|
|
|
|
|
dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"};
|
|
|
|
|
dynamic bahrainCountry = {"id": 973, "name": "Bahrain"};
|
|
|
|
|
dynamic kuwaitCountry = {"id": 965, "name": "Kuwait"};
|
|
|
|
|
dynamic afghanistanCountry = {"id": 93, "name": "Afghanistan"};
|
|
|
|
|
dynamic algeriaCountry = {"id": 213, "name": "Algeria"};
|
|
|
|
|
dynamic argentinaCountry = {"id": 54, "name": "Argentina"};
|
|
|
|
|
dynamic bangladeshCountry = {"id": 880, "name": "Bangladesh"};
|
|
|
|
|
dynamic colombiaCountry = {"id": 57, "name": "Colombia"};
|
|
|
|
|
dynamic croatiaCountry = {"id": 385, "name": "Croatia"};
|
|
|
|
|
dynamic denmarkCountry = {"id": 45, "name": "Denmark"};
|
|
|
|
|
dynamic ecuadorCountry = {"id": 593, "name": "Ecuador"};
|
|
|
|
|
dynamic egyptCountry = {"id": 20, "name": "Egypt"};
|
|
|
|
|
dynamic ethiopiaCountry = {"id": 251, "name": "Ethiopia"};
|
|
|
|
|
dynamic greeceCountry = {"id": 30, "name": "Greece"};
|
|
|
|
|
dynamic icelandCountry = {"id": 354, "name": "Iceland"};
|
|
|
|
|
dynamic indonesiaCountry = {"id": 62, "name": "Indonesia"};
|
|
|
|
|
dynamic iraqCountry = {"id": 971, "name": "Iraq"};
|
|
|
|
|
dynamic liberiaCountry = {"id": 231, "name": "Liberia"};
|
|
|
|
|
dynamic senegalCountry = {"id": 221, "name": "Senegal"};
|
|
|
|
|
|
|
|
|
|
countryList.add(ksaCountry);
|
|
|
|
|
countryList.add(uaeCountry);
|
|
|
|
|
countryList.add(bahrainCountry);
|
|
|
|
|
countryList.add(kuwaitCountry);
|
|
|
|
|
countryList.add(afghanistanCountry);
|
|
|
|
|
countryList.add(algeriaCountry);
|
|
|
|
|
countryList.add(argentinaCountry);
|
|
|
|
|
countryList.add(bangladeshCountry);
|
|
|
|
|
countryList.add(colombiaCountry);
|
|
|
|
|
countryList.add(croatiaCountry);
|
|
|
|
|
countryList.add(denmarkCountry);
|
|
|
|
|
countryList.add(ecuadorCountry);
|
|
|
|
|
countryList.add(egyptCountry);
|
|
|
|
|
countryList.add(ethiopiaCountry);
|
|
|
|
|
countryList.add(greeceCountry);
|
|
|
|
|
countryList.add(icelandCountry);
|
|
|
|
|
countryList.add(indonesiaCountry);
|
|
|
|
|
countryList.add(iraqCountry);
|
|
|
|
|
countryList.add(liberiaCountry);
|
|
|
|
|
countryList.add(senegalCountry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -221,9 +257,10 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
dropDownText: getBirthdate(),
|
|
|
|
|
enabled: false,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
validationError: _birthDateInGregorian == null && isSubmitted
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
: null,
|
|
|
|
|
validationError:
|
|
|
|
|
_birthDateInGregorian == null && isSubmitted
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
: null,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
@ -240,17 +277,18 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
|
birthDateInHijri = selectedDate;
|
|
|
|
|
_birthDateInGregorian = HijriCalendar().hijriToGregorian(
|
|
|
|
|
birthDateInHijri.hYear,
|
|
|
|
|
birthDateInHijri.hMonth,
|
|
|
|
|
birthDateInHijri.hDay);
|
|
|
|
|
_birthDateInGregorian = HijriCalendar()
|
|
|
|
|
.hijriToGregorian(
|
|
|
|
|
birthDateInHijri.hYear,
|
|
|
|
|
birthDateInHijri.hMonth,
|
|
|
|
|
birthDateInHijri.hDay);
|
|
|
|
|
print(_birthDateInGregorian);
|
|
|
|
|
print(birthDateInHijri);
|
|
|
|
|
} else {
|
|
|
|
|
_birthDateInGregorian = selectedDate;
|
|
|
|
|
birthDateInHijri = HijriCalendar()
|
|
|
|
|
.gregorianToHijri(
|
|
|
|
|
selectedDate.year, selectedDate.month, selectedDate.day);
|
|
|
|
|
.gregorianToHijri(selectedDate.year,
|
|
|
|
|
selectedDate.month, selectedDate.day);
|
|
|
|
|
|
|
|
|
|
print(_birthDateInGregorian);
|
|
|
|
|
print(birthDateInHijri);
|
|
|
|
|
@ -259,7 +297,6 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 70,
|
|
|
|
|
),
|
|
|
|
|
@ -436,16 +473,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getBirthdate() {
|
|
|
|
|
|
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
|
return birthDateInHijri != null
|
|
|
|
|
? "$birthDateInHijri"
|
|
|
|
|
: null;
|
|
|
|
|
}else{
|
|
|
|
|
return birthDateInHijri != null ? "$birthDateInHijri" : null;
|
|
|
|
|
} else {
|
|
|
|
|
return _birthDateInGregorian != null
|
|
|
|
|
? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}"
|
|
|
|
|
: null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|