text to speech

merge-requests/34/merge
Sultan Khan 5 years ago
parent 2f9885ecf8
commit 9b55309d53

@ -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<Search> with SingleTickerProviderStateMixin {
physics: NeverScrollableScrollPhysics(),
children: [SearchByClinic(), SearchByDoctor()],
controller: _tabController),
floatingActionButton: FloatingSearchButton());
bottomNavigationBar: BottomBarSearch());
}
}

@ -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,

@ -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());
// });
}
}

Loading…
Cancel
Save