|
|
|
|
@ -31,6 +31,7 @@ import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
|
|
|
|
|
import 'dart:math';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:smart_progress_bar/smart_progress_bar.dart';
|
|
|
|
|
|
|
|
|
|
class BottomBarSearch extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
@ -83,7 +84,7 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
maxLines: null,
|
|
|
|
|
controller: searchController,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
hintText: 'How May I Help You?',
|
|
|
|
|
hintText: TranslationBase.of(context).textToSpeech,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(Icons.mic),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
@ -210,6 +211,7 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
result['ClinicId'],
|
|
|
|
|
context,
|
|
|
|
|
doctorId: result['DoctorId'],
|
|
|
|
|
doctorName: result['DoctorName'],
|
|
|
|
|
);
|
|
|
|
|
} else if (result['ProjectId'] != 0 &&
|
|
|
|
|
result['ClinicId'] != 0 &&
|
|
|
|
|
@ -234,6 +236,8 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
result['ProjectId'],
|
|
|
|
|
result['ClinicId'],
|
|
|
|
|
context,
|
|
|
|
|
doctorId: result['DoctorId'],
|
|
|
|
|
doctorName: result['DoctorName'],
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
@ -298,14 +302,17 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
isAppo: true);
|
|
|
|
|
//speak();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
}).showProgressBar(
|
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDoctorsList(projectId, clinicId, context, {doctorId}) {
|
|
|
|
|
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) {
|
|
|
|
|
List<DoctorList> doctorsList = [];
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.getDoctorsList(clinicId, projectId, context, doctorId: doctorId)
|
|
|
|
|
.getDoctorsList(clinicId, projectId, context, doctorId: doctorName)
|
|
|
|
|
.then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
setState(() {
|
|
|
|
|
@ -314,12 +321,13 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
res['DoctorList'].forEach((v) {
|
|
|
|
|
doctorsList.add(new DoctorList.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
if (doctorId == null) {
|
|
|
|
|
navigateToSearchResults(context, doctorsList);
|
|
|
|
|
//speak();
|
|
|
|
|
} else {
|
|
|
|
|
if (res['DoctorList'].length == 1 && doctorId != null) {
|
|
|
|
|
getDoctorProfile(
|
|
|
|
|
projectId, clinicId, doctorId, context, doctorsList);
|
|
|
|
|
|
|
|
|
|
//speak();
|
|
|
|
|
} else {
|
|
|
|
|
navigateToSearchResults(context, doctorsList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -328,7 +336,8 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}).showProgressBar(
|
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToDoctorProfile(context, docObject, docProfile,
|
|
|
|
|
|