merge-update-with-lab-changes
Sultan Khan 6 years ago
parent 1974e51602
commit 3247378c02

@ -361,5 +361,6 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"}, "consultation": {"en": "Consultation", "ar": "استشارة"},
"logs": {"en": "Logs", "ar": "السجلات"} "logs": {"en": "Logs", "ar": "السجلات"},
"textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}
}; };

@ -31,7 +31,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID

@ -45,7 +45,7 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
"DoctorID": doctorId, //!= null ? doctorId : 0, "DoctorName": 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,

@ -447,6 +447,8 @@ class TranslationBase {
String get consultation => String get consultation =>
localizedValues['consultation'][locale.languageCode]; localizedValues['consultation'][locale.languageCode];
String get logs => localizedValues['logs'][locale.languageCode]; String get logs => localizedValues['logs'][locale.languageCode];
String get textToSpeech =>
localizedValues['textToSpeech'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

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

Loading…
Cancel
Save