diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index d759fafa..ee9bbfdf 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; import 'package:flutter/material.dart'; @@ -42,6 +43,6 @@ class _SearchState extends State with SingleTickerProviderStateMixin { physics: NeverScrollableScrollPhysics(), children: [SearchByClinic(), SearchByDoctor()], controller: _tabController), - floatingActionButton: FloatingSearchButton()); + bottomNavigationBar: BottomBarSearch()); } } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index fe5ed6fb..c1bf3056 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -45,6 +45,7 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "ClinicID": clinicID, "ProjectID": projectID, + "DoctorID": doctorId, //!= null ? doctorId : 0, "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": true, "PatientID": authUser.patientID != null ? authUser.patientID : 0, diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index edb67f67..d0633b14 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -201,30 +201,48 @@ class _SearchBot extends State { switch (result["CommandNumber"]) { case 100: - if (result['ProjectId'] != null && - result['ClinicId'] != null && - result['DoctorId'] != null) { + if (result['ProjectId'] != 0 && + result['ClinicId'] != 0 && + result['DoctorId'] != 0) { getDoctorsList( result['ProjectId'], result['ClinicId'], context, doctorId: result['DoctorId'], ); - } else if (result['ProjectId'] != null && result['ClinicId'] != 0) { + } else if (result['ProjectId'] != 0 && + result['ClinicId'] != 0 && + result['DoctorId'] == 0) { getDoctorsList( result['ProjectId'], result['ClinicId'], context, ); - } else if (result['ProjectId'] != null && result['ClinicId'] == 0) { + } else if (result['ProjectId'] == 0 && + result['ClinicId'] != 0 && + result['DoctorId'] == 0) { + getDoctorsList( + result['ProjectId'], + result['ClinicId'], + context, + ); + } else if (result['ProjectId'] == 0 && + result['ClinicId'] != 0 && + result['DoctorId'] != 0) { + getDoctorsList( + result['ProjectId'], + result['ClinicId'], + context, + ); + } else { Navigator.push( AppGlobal.context, MaterialPageRoute( builder: (context) => Search( type: 0, ))); - speak(); } + speak(); break; // case '101': // Navigator.push( @@ -253,17 +271,18 @@ class _SearchBot extends State { // eventProvider.setValue({"doctor_id": understand}); // break; default: - { - if (result['ProjectId'] != null && - result['ClinicId'] != null && - result['DoctorId'] == 0) { - getDoctorsList( - result['ProjectId'], - result['ClinicId'], - context, - ); - } - } + // { + // if (result['ProjectId'] != null && + // result['ClinicId'] != null && + // result['DoctorId'] == 0) { + // getDoctorsList( + // result['ProjectId'], + // result['ClinicId'], + // context, + // ); + speak(); + //} + //} break; } @@ -287,7 +306,7 @@ class _SearchBot extends State { navigateToDoctorProfile(context, doctorData[0], docProfileList[0], isAppo: true); - speak(); + //speak(); } }); } @@ -307,7 +326,7 @@ class _SearchBot extends State { }); if (doctorId == null) { navigateToSearchResults(context, doctorsList); - speak(); + //speak(); } else { getDoctorProfile( projectId, clinicId, doctorId, context, doctorsList); @@ -347,8 +366,8 @@ class _SearchBot extends State { } else if (results['ReturnMessage_Ar'] != null) { await flutterTts.speak(results['ReturnMessage_Ar']); } - Future.delayed(const Duration(seconds: 3), () { - initSpeechState().then((value) => startVoiceSearch()); - }); + // Future.delayed(const Duration(seconds: 10), () { + // initSpeechState().then((value) => startVoiceSearch()); + // }); } }