|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'dart:collection';
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
|
|
|
|
|
@ -311,6 +313,7 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
|
|
|
|
|
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) {
|
|
|
|
|
List<DoctorList> doctorsList = [];
|
|
|
|
|
List<String> arr = [];
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.getDoctorsList(clinicId, projectId, context, doctorId: doctorName)
|
|
|
|
|
@ -319,8 +322,10 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (res['DoctorList'].length != 0) {
|
|
|
|
|
doctorsList.clear();
|
|
|
|
|
|
|
|
|
|
res['DoctorList'].forEach((v) {
|
|
|
|
|
doctorsList.add(new DoctorList.fromJson(v));
|
|
|
|
|
arr.add(new DoctorList.fromJson(v).projectName);
|
|
|
|
|
});
|
|
|
|
|
if (res['DoctorList'].length == 1 && doctorId != null) {
|
|
|
|
|
getDoctorProfile(
|
|
|
|
|
@ -328,7 +333,7 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
|
|
|
|
|
//speak();
|
|
|
|
|
} else {
|
|
|
|
|
navigateToSearchResults(context, doctorsList);
|
|
|
|
|
navigateToSearchResults(context, doctorsList, arr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -353,11 +358,20 @@ class _SearchBot extends State<BottomBarSearch> {
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToSearchResults(context, docList) async {
|
|
|
|
|
Future navigateToSearchResults(context, docList, arr) async {
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) => SearchResults(doctorsList: docList)));
|
|
|
|
|
var result = LinkedHashSet<String>.from(arr).toList();
|
|
|
|
|
var numAll = result.length;
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => SearchResults(doctorsList: docList)));
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
BranchView(doctorsList: docList, result: result, num: numAll),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
speak() async {
|
|
|
|
|
|