text to speech

merge-update-with-lab-changes
Sultan Khan 6 years ago
parent 2f9885ecf8
commit 9b55309d53

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -42,6 +43,6 @@ class _SearchState extends State<Search> with SingleTickerProviderStateMixin {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [SearchByClinic(), SearchByDoctor()], children: [SearchByClinic(), SearchByDoctor()],
controller: _tabController), controller: _tabController),
floatingActionButton: FloatingSearchButton()); bottomNavigationBar: BottomBarSearch());
} }
} }

@ -45,6 +45,7 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
"DoctorID": doctorId, //!= null ? doctorId : 0,
"ContinueDentalPlan": false, "ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true, "IsSearchAppointmnetByClinicID": true,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,

@ -201,30 +201,48 @@ class _SearchBot extends State<BottomBarSearch> {
switch (result["CommandNumber"]) { switch (result["CommandNumber"]) {
case 100: case 100:
if (result['ProjectId'] != null && if (result['ProjectId'] != 0 &&
result['ClinicId'] != null && result['ClinicId'] != 0 &&
result['DoctorId'] != null) { result['DoctorId'] != 0) {
getDoctorsList( getDoctorsList(
result['ProjectId'], result['ProjectId'],
result['ClinicId'], result['ClinicId'],
context, context,
doctorId: result['DoctorId'], 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'] == 0 &&
result['ClinicId'] != 0 &&
result['DoctorId'] == 0) {
getDoctorsList( getDoctorsList(
result['ProjectId'], result['ProjectId'],
result['ClinicId'], result['ClinicId'],
context, 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 {
Navigator.push( Navigator.push(
AppGlobal.context, AppGlobal.context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Search( builder: (context) => Search(
type: 0, type: 0,
))); )));
speak();
} }
speak();
break; break;
// case '101': // case '101':
// Navigator.push( // Navigator.push(
@ -253,17 +271,18 @@ class _SearchBot extends State<BottomBarSearch> {
// eventProvider.setValue({"doctor_id": understand}); // eventProvider.setValue({"doctor_id": understand});
// break; // break;
default: default:
{ // {
if (result['ProjectId'] != null && // if (result['ProjectId'] != null &&
result['ClinicId'] != null && // result['ClinicId'] != null &&
result['DoctorId'] == 0) { // result['DoctorId'] == 0) {
getDoctorsList( // getDoctorsList(
result['ProjectId'], // result['ProjectId'],
result['ClinicId'], // result['ClinicId'],
context, // context,
); // );
} speak();
} //}
//}
break; break;
} }
@ -287,7 +306,7 @@ class _SearchBot extends State<BottomBarSearch> {
navigateToDoctorProfile(context, doctorData[0], docProfileList[0], navigateToDoctorProfile(context, doctorData[0], docProfileList[0],
isAppo: true); isAppo: true);
speak(); //speak();
} }
}); });
} }
@ -307,7 +326,7 @@ class _SearchBot extends State<BottomBarSearch> {
}); });
if (doctorId == null) { if (doctorId == null) {
navigateToSearchResults(context, doctorsList); navigateToSearchResults(context, doctorsList);
speak(); //speak();
} else { } else {
getDoctorProfile( getDoctorProfile(
projectId, clinicId, doctorId, context, doctorsList); projectId, clinicId, doctorId, context, doctorsList);
@ -347,8 +366,8 @@ class _SearchBot extends State<BottomBarSearch> {
} else if (results['ReturnMessage_Ar'] != null) { } else if (results['ReturnMessage_Ar'] != null) {
await flutterTts.speak(results['ReturnMessage_Ar']); await flutterTts.speak(results['ReturnMessage_Ar']);
} }
Future.delayed(const Duration(seconds: 3), () { // Future.delayed(const Duration(seconds: 10), () {
initSpeechState().then((value) => startVoiceSearch()); // initSpeechState().then((value) => startVoiceSearch());
}); // });
} }
} }

Loading…
Cancel
Save