|
|
|
|
@ -108,17 +108,22 @@ class AskDoctorPage extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> checkIfDoctorAvailable(DoctorList _doctor, BuildContext context) {
|
|
|
|
|
Future<bool> checkIfDoctorAvailable(DoctorList _doctor, BuildContext context) async {
|
|
|
|
|
AskDoctorService askDocservice = new AskDoctorService();
|
|
|
|
|
bool isAvailable = false;
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.isDoctorAvailable(doctorId: _doctor.doctorID, projectId: _doctor.projectID, clinicId: _doctor.clinicID).then((res) {
|
|
|
|
|
await askDocservice.isDoctorAvailable(doctorId: _doctor.doctorID, projectId: _doctor.projectID, clinicId: _doctor.clinicID).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(res['IsDoctorAvailable']);
|
|
|
|
|
if (res['IsDoctorAvailable']) {
|
|
|
|
|
isAvailable = true;
|
|
|
|
|
if (res != null) {
|
|
|
|
|
print(res['IsDoctorAvailable']);
|
|
|
|
|
if (res['IsDoctorAvailable']) {
|
|
|
|
|
isAvailable = true;
|
|
|
|
|
} else {
|
|
|
|
|
isAvailable = false;
|
|
|
|
|
AppToast.showErrorToast(message: res['endUserMessage'], localContext: context);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
isAvailable = false;
|
|
|
|
|
AppToast.showErrorToast(message: res['endUserMessage'], localContext: context);
|
|
|
|
|
isAvailable = true;
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|