|
|
|
|
@ -201,30 +201,48 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
|
|
|
|
|
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<BottomBarSearch> {
|
|
|
|
|
// 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<BottomBarSearch> {
|
|
|
|
|
|
|
|
|
|
navigateToDoctorProfile(context, doctorData[0], docProfileList[0],
|
|
|
|
|
isAppo: true);
|
|
|
|
|
speak();
|
|
|
|
|
//speak();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -307,7 +326,7 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
});
|
|
|
|
|
if (doctorId == null) {
|
|
|
|
|
navigateToSearchResults(context, doctorsList);
|
|
|
|
|
speak();
|
|
|
|
|
//speak();
|
|
|
|
|
} else {
|
|
|
|
|
getDoctorProfile(
|
|
|
|
|
projectId, clinicId, doctorId, context, doctorsList);
|
|
|
|
|
@ -347,8 +366,8 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
} 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());
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|