|
|
|
|
@ -58,6 +58,7 @@ class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointm
|
|
|
|
|
onValueSelected: (index) {
|
|
|
|
|
print(index);
|
|
|
|
|
_selectedProjectID = index;
|
|
|
|
|
getBloodDonationFreeSlots();
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -73,17 +74,17 @@ class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointm
|
|
|
|
|
getBloodDonationFreeSlots() {
|
|
|
|
|
BloodDonationService service = new BloodDonationService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.getBloodDonationProjectsList().then((res) {
|
|
|
|
|
service.getBloodDonationFreeSlots(134, _selectedProjectID).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(res['BD_getProjectsHaveBDClinics']);
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
res['BD_getProjectsHaveBDClinics'].forEach((element) {
|
|
|
|
|
bloodDonationProjectsListResponse.add(BloodDonationProjectsListResponse.fromJson(element));
|
|
|
|
|
});
|
|
|
|
|
print(bloodDonationProjectsListResponse.length);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
|
}
|
|
|
|
|
print(res['BD_FreeSlots']);
|
|
|
|
|
// if (res["MessageStatus"] == 1) {
|
|
|
|
|
// res['BD_getProjectsHaveBDClinics'].forEach((element) {
|
|
|
|
|
// bloodDonationProjectsListResponse.add(BloodDonationProjectsListResponse.fromJson(element));
|
|
|
|
|
// });
|
|
|
|
|
// print(bloodDonationProjectsListResponse.length);
|
|
|
|
|
// } else {
|
|
|
|
|
// AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
|
// }
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
|