Merge branch 'development_v3.3' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

 Conflicts:
	lib/config/config.dart
	lib/core/service/client/base_app_client.dart
	lib/core/viewModels/er/EdOnlineViewModel.dart
	lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart
	lib/pages/BookAppointment/DentalComplaints.dart
	lib/pages/BookAppointment/components/SearchByClinic.dart
	lib/pages/BookAppointment/widgets/DentalComplaintCard.dart
	lib/pages/BookAppointment/widgets/DoctorView.dart
	lib/pages/DrawerPages/family/my-family.dart
	lib/pages/MyAppointments/MyAppointments.dart
	lib/pages/landing/landing_page.dart
	lib/pages/livecare/widgets/clinic_card.dart
	lib/pages/login/login.dart
	lib/pages/rateAppointment/rate_appointment_clinic.dart
	lib/pages/rateAppointment/rate_appointment_doctor.dart
	lib/services/clinic_services/get_clinic_service.dart
	lib/uitl/push-notification-handler.dart
	lib/widgets/others/bottom_bar.dart
	pubspec.yaml
dev_v3.13.6_voipcall
Sultan khan 10 months ago
commit d0c7b08eac

@ -20,6 +20,10 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'http://10.50.100.198:4422/';
//var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
@ -339,7 +343,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 11.6;
var VERSION_ID = 11.7;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;

@ -36,7 +36,7 @@ class AppointmentRateService extends BaseService {
}, body: bodyData);
}
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async {
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async {
hasError = false;
AppointmentRate appointmentRate = AppointmentRate();
appointmentRate.rate = rate;
@ -47,6 +47,7 @@ class AppointmentRateService extends BaseService {
appointmentRate.note = note;
appointmentRate.createdBy = 2;
appointmentRate.editedBy = 2;
appointmentRate.languageID = languageID;
await baseAppClient.post(NEW_RATE_APPOINTMENT_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;

@ -81,8 +81,10 @@ class BaseAppClient {
body['Channel'] = CHANNEL;
if (body.containsKey('LanguageID')) {
if (body['LanguageID'] != null) {
body['LanguageID'] = body['LanguageID'];
if(body['LanguageID'] != null) {
//change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] =='ar' ? 1 : body['LanguageID'] =='en' ? 2 : body['LanguageID'];
} else {
body['LanguageID'] =
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false)
@ -186,7 +188,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021";
// body['PatientID'] = 1231755; //3844083
// body['PatientID'] = 1014144; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -50,13 +50,14 @@ class HospitalService extends BaseService {
}
}
Future getHospitals({bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async {
Future getHospitals(int languageID, {bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async {
if (isResBasedOnLoc) await _getCurrentLocation();
Map<String, dynamic> body = Map();
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['IsAdvancePayment'] = isAdvancePayment;
body['LanguageID'] = languageID;
await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();

@ -35,9 +35,9 @@ class AppointmentRateViewModel extends BaseViewModel {
}
}
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async {
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async {
setState(ViewState.Busy);
await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note);
await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note, languageID);
if (_appointmentRateService.hasError) {
error = _appointmentRateService.error!;
setState(ViewState.ErrorLocal);

@ -19,15 +19,15 @@ class EdOnlineViewModel extends BaseViewModel {
ErPatientShareModel? get erPatientShareModel => _edOnlineServices.erPatientShareModel;
Future getHospitals() async {
if (_hospitalService.hospitals.isEmpty) {
setState(ViewState.Busy);
await _hospitalService.getHospitals();
if (_hospitalService.hasError) {
error = _hospitalService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
Future getHospitals(int languageID) async {
if(_hospitalService.hospitals.isEmpty){
setState(ViewState.Busy);
await _hospitalService.getHospitals(languageID);
if (_hospitalService.hasError) {
error = _hospitalService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}
@ -36,7 +36,7 @@ class EdOnlineViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _edOnlineServices.getQuestions();
if (_edOnlineServices.hasError) {
error = _edOnlineServices.error!;
error = _edOnlineServices!.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);

@ -46,19 +46,19 @@ class AmRequestViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getAmRequestOrders() async {
Future getAmRequestOrders(int languageID) async {
setState(ViewState.Busy);
await _amService.getAllTransportationOrders();
if (_amService.hasError) {
error = _amService.error!;
setState(ViewState.Error);
} else
getHospitals();
getHospitals(languageID);
}
Future getHospitals() async {
Future getHospitals(int languageID) async {
setState(ViewState.Busy);
await _hospitalService.getHospitals(isResBasedOnLoc: false);
await _hospitalService.getHospitals(languageID, isResBasedOnLoc: false);
if (_hospitalService.hasError) {
error = _hospitalService.error!;
setState(ViewState.Error);

@ -10,9 +10,9 @@ class HospitalViewModel extends BaseViewModel {
List<HospitalsModel> get hospitals => _hospitalService.hospitals;
Future getHospitals() async {
Future getHospitals(int languageID) async {
setState(ViewState.Busy);
await _hospitalService.getHospitals();
await _hospitalService.getHospitals(languageID);
if (_hospitalService.hasError) {
error = _hospitalService.error!;
setState(ViewState.Error);

@ -70,9 +70,9 @@ class MyBalanceViewModel extends BaseViewModel {
}
}
Future getHospitals({bool isAdvancePayment = false}) async {
Future getHospitals(int languageID, {bool isAdvancePayment = false}) async {
setState(ViewState.Busy);
await _hospitalService.getHospitals(isAdvancePayment: isAdvancePayment);
await _hospitalService.getHospitals(languageID, isAdvancePayment: isAdvancePayment);
if (_hospitalService.hasError) {
error = _hospitalService.error!;
setState(ViewState.Error);

@ -44,6 +44,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
HospitalsModel? selectedHospital;
final GlobalKey projectDropdownKey = GlobalKey();
bool isLocationSelected = false;
ProjectViewModel projectViewModel;
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
@ -80,7 +81,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
description: TranslationBase.of(context).infoCMC,
@ -402,10 +403,11 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
}
getProjectsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
List<HospitalsModel> projectsListLocal = [];
service.getProjectsList(context).then((res) {
service.getProjectsList(languageID, context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['ListProject'].forEach((v) {

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart';
@ -22,6 +23,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../dialogs/select_city_dialog.dart';
@ -436,9 +438,10 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
}
void getAllProjects() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = [];
service.getProjectsList(context).then((res) {
service.getProjectsList(languageID, context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['ListProject'].forEach((v) {

@ -66,7 +66,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
title: Texts("${item.diseases}"),
activeColor: Colors.blue.shade700,
value: item.diseasesID,
groupValue: _selectedDisease != null ? _selectedDisease!.diseasesID : -1,
groupValue: _selectedDisease != null ? _selectedDisease!.diseasesID! : -1,
selected: _selectedDisease != null ? item.diseasesID == _selectedDisease!.diseasesID : false,
onChanged: (val) {
setState(() {
@ -114,7 +114,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16),
child: BorderedButton(
TranslationBase.of(context).skip,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontSize: SizeConfig!.textMultiplier! * 2.1,
textColor: Colors.blue,
vPadding: 8,
hPadding: 8,
@ -139,6 +139,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
}
callDoctorsSearchAPI() {
int languageID = projectProvider.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
@ -148,7 +149,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) {
service.getDoctorsList(108, 0, false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -1,8 +1,8 @@
import 'dart:collection';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
class ResultPage extends StatefulWidget {
final double finalResult;
@ -137,6 +138,7 @@ class _ResultPageState extends State<ResultPage> {
}
callDoctorsSearchAPI() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
@ -146,7 +148,7 @@ class _ResultPageState extends State<ResultPage> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) {
service.getDoctorsList(108, 0, false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -137,7 +137,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
checkIfHasDentalPlan() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.checkIfHasDentalPlan(widget.searchInfo.ProjectID!, context).then((res) {
service.checkIfHasDentalPlan(widget.searchInfo!.ProjectID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['List_IsPatientHasOnGoingEstimation'].length != 0) {
@ -183,7 +183,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
tableRow.add(TableRow(children: [
Container(
margin: EdgeInsets.all(12.0),
child: Text(procedure.procedureName!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Text(procedure!.procedureName!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
),
Container(
margin: EdgeInsets.all(12.0),
@ -209,17 +209,18 @@ class _DentalComplaintsState extends State<DentalComplaints> {
}
continueDentalPlan() {
int languageID = projectViewModel.isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
int appoTime = 0;
service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID!, false, context, isContinueDentalPlan: true).then((res) {
service.getDoctorsList(int.parse("17"), widget.searchInfo!.ProjectID, false, languageID, context, isContinueDentalPlan: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
dentalProceduresModel = DentalProceduresModel.fromJson(res as Map<String, dynamic>);
//Changed by Aamir added Map into string dynamic
dentalProceduresModel.listIsPatientHasOnGoingEstimation!.forEach((procedure) {
appoTime += procedure.neededTime!;
appoTime += procedure!.neededTime!;
});
setState(() {
hasDentalPlan = true;
@ -257,10 +258,11 @@ class _DentalComplaintsState extends State<DentalComplaints> {
}
getChiefComplaintsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
getLanguageID();
ClinicListService service = new ClinicListService();
service.getChiefComplaintsList(widget.searchInfo.ClinicID!, widget.searchInfo.ProjectID!, context).then((res) {
service.getChiefComplaintsList(widget.searchInfo!.ClinicID!, widget.searchInfo!.ProjectID!, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
@ -63,7 +64,7 @@ class _QRCodeState extends State<QRCode> {
widget.authUser = new AuthenticatedUser();
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// startNFCScan();
// startNFCScan();
// });
super.initState();
@ -242,19 +243,17 @@ class _QRCodeState extends State<QRCode> {
optionsList.add(
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(80) && _supportsNFC) {
startNFCScan();
} else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
if (projectViewModel.havePrivilege(102)) {
startLocationCheckIn();
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).scanNFC,
imagePath: 'contactless.svg',
title: TranslationBase.of(context).checkInViaLocation,
imagePath: 'location.svg',
subTitle: "",
isEnable: projectViewModel.havePrivilege(80),
width: 80.0,
height: 80.0,
isEnable: projectViewModel.havePrivilege(102),
width: 70.0,
height: 70.0,
),
),
);
@ -280,17 +279,19 @@ class _QRCodeState extends State<QRCode> {
optionsList.add(
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(102)) {
startLocationCheckIn();
if (projectViewModel.havePrivilege(80) && _supportsNFC) {
startNFCScan();
} else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).checkInViaLocation,
imagePath: 'location.svg',
title: TranslationBase.of(context).scanNFC,
imagePath: 'contactless.svg',
subTitle: "",
isEnable: projectViewModel.havePrivilege(102),
width: 70.0,
height: 70.0,
isEnable: projectViewModel.havePrivilege(80),
width: 80.0,
height: 80.0,
),
),
);
@ -415,6 +416,7 @@ class _QRCodeState extends State<QRCode> {
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
},
),
],

@ -204,6 +204,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
}
callDoctorsSearchAPI() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
@ -214,7 +215,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
DoctorsListService service = new DoctorsListService();
projectViewModel.selectedBodyPartList = _selectedBodyPartList;
service.getDoctorsList(253, 0, false, context).then((res) {
service.getDoctorsList(253, 0, false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -527,10 +527,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
getProjectsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = [];
service
.getProjectsList(context)
.getProjectsList(languageID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
@ -600,6 +601,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
callDoctorsSearchAPI(int clinicID) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
@ -609,7 +611,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue!) : 0, nearestAppo, context).then((res) {
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -90,13 +90,14 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
getDoctorsList(BuildContext context) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[];
service.getDoctorsListByName(doctorNameController.text, context).then((res) {
service.getDoctorsListByName(doctorNameController.text, languageID, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class DentalComplaintCard extends StatefulWidget {
@ -43,7 +45,7 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
children: <Widget>[
Container(
child: Text(
widget.listDentalChiefComplain.name!,
widget.listDentalChiefComplain!.name!,
style: TextStyle(
fontSize: 16.0,
color: Colors.black,
@ -60,12 +62,13 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
}
getChiefComplaintsList() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[];
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD!, widget.listDentalChiefComplain.projectID!, context).then((res) {
service.getChiefComplaintDoctorList(widget.listDentalChiefComplain!.iD!, widget.listDentalChiefComplain.projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['List_DentalDoctorChiefComplaintMapping']);

@ -214,10 +214,11 @@ class DoctorView extends StatelessWidget {
}
getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsProfile(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, context).then((res) {
service.getDoctorsProfile(docObject.doctorID!, docObject.clinicID!, docObject!.projectID!, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {

@ -562,9 +562,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID);
}
familySharedRecordsList =[];
sentRecordsList = [];
familySharedRecordsList = [];
familySharedRecords.getAllSharedRecordsByStatusList!.forEach((element) {
familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) {
if (element.status == 3) {
familySharedRecordsList.add(element);
}

@ -40,7 +40,7 @@ class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderSt
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png'));
return BaseView<AmRequestViewModel>(
onModelReady: (model) => model.getAmRequestOrders(),
onModelReady: (model) => model.getAmRequestOrders(projectViewModel.isArabic ? 1 : 2),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
showNewAppBarTitle: true,

@ -39,7 +39,7 @@ class _EdOnlineSelectedHospitalPageState
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getHospitals(),
onModelReady: (model) => model.getHospitals(projectViewModel.isArabic ? 1 : 2),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
body: SingleChildScrollView(

@ -55,6 +55,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
int _currentPage = 0;
ToDoCountProviderModel? toDoProvider;
ProjectViewModel projectViewModel;
@override
void initState() {
@ -76,6 +77,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).myAppointmentsList,
@ -135,6 +137,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}
getPatientAppointmentHistory() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
widget.appoList.clear();
@ -150,7 +153,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
widget._patientConfirmedAppointmentListClinic.clear();
widget._patientArrivedAppointmentListClinic.clear();
service.getPatientAppointmentHistory(false, context).then((res) {
service.getPatientAppointmentHistory(false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['MessageStatus'] == 1) {

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class VisitTicket extends StatefulWidget {
List<DoctorList> appoList = [];
@ -17,6 +19,7 @@ class VisitTicket extends StatefulWidget {
class _VisitTicketState extends State<VisitTicket> {
bool isLoading = false;
ProjectViewModel projectViewModel;
@override
void initState() {
@ -26,6 +29,7 @@ class _VisitTicketState extends State<VisitTicket> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList,
body: isLoading == false
@ -48,9 +52,10 @@ class _VisitTicketState extends State<VisitTicket> {
}
getPatientAppointmentCurfewHistory(BuildContext context) {
int languageID = projectViewModel.isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientAppointmentHistory(true, context).then((res) {
service.getPatientAppointmentHistory(true, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -372,10 +372,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
// }
openAppointmentLabResults() {
int languageID = widget.projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
PatientLabOrders patientLabOrders = new PatientLabOrders();
service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, context).then((res) {
service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, languageID, context).then((res) {
print(res['ListLabResultsByAppNo']);
GifLoaderDialogUtils.hideDialog(context);
if (res['ListLabResultsByAppNo'] != null) {
@ -407,10 +408,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
openAppointmentRadiology() {
int languageID = widget.projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context).then((res) {
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['FinalRadiologyList'] != null) {
print(res['FinalRadiologyList']);

@ -846,9 +846,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
getPatientAppointmentHistory() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) {
service.getPatientAppointmentHistory(true, languageID, context).then((res) {
widget.appoList.clear();
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {

@ -58,6 +58,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
List<AppoitmentAllHistoryResultList> appoList = [];
ProjectViewModel projectViewModel;
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
@ -109,7 +111,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return BaseView<FeedbackViewModel>(
allowAny: true,
builder: (_, model, widget) => AppScaffold(
@ -469,6 +471,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
listData: list,
selectedIndex: selectedStatusIndex,
onValueSelected: (index) {
int languageID = projectViewModel.isArabic ? 1 : 2;
selectedStatusIndex = index;
if (index == 1) {
@ -488,7 +491,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (messageType == MessageType.ComplaintOnAnAppointment) {
appoList.clear();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
service.getPatientAppointmentHistory(false, languageID, context, isForCOC: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['MessageStatus'] == 1) {

@ -630,18 +630,32 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
authService.getDashboard().then((value) => {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'].isNotEmpty ?? value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99
? '99+'
: value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(int.parse(notificationCount.split("+").first));
}
}),
});
authService.getDashboard().then((value) async {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
}
});
// if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) {
// int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
// appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) async {
// if (appointmentRateViewModel.isHaveAppointmentNotRate) {
// await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true);
// Navigator.push(
// context,
// FadePage(
// page: RateAppointmentDoctor(),
// ),
// );
// }
// }).catchError((err) {
// print(err);
// });
// }
});
}
projectViewModel.analytics.setUser(data);
} else {

@ -163,10 +163,10 @@ class _State extends State<ClinicCard> {
}
getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) {
int languageID = widget.languageID == 'ar' ? 1 : 2;
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinicTiming(patientERGetClinicsList.serviceID!, context).then((res) {
service.getLivecareClinicTiming(patientERGetClinicsList!.serviceID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -514,7 +514,7 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded = false;
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinics(context).then((res) {
service.getLivecareClinics(languageID == 'ar' ? 1: 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['PatientER_GetClinicsList'].length);
if (res['MessageStatus'] == 1) {

@ -682,11 +682,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
checkIfUserAgreedBefore(CheckActivationCode result) {
if (result.isNeedUserAgreement == true) {
//move to agreement page.
} else {
goToHome();
}
// if (result.isNeedUserAgreement == true) {
//move to agreement page.
// } else {
goToHome();
// }
}
checkIfIsInPatient() {
@ -746,17 +746,45 @@ class _ConfirmLogin extends State<ConfirmLogin> {
projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true);
GifLoaderDialogUtils.hideDialog(context);
// GifLoaderDialogUtils.hideDialog(context);
getToDoCount();
appointmentRateViewModel
.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
.then((value) => {
GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
},
insertIMEI()
})
.catchError((err) {
print(err);
});
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false);
insertIMEI();
// getToDoCount();
// Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: LandingPage(),
// ),
// (r) => false);
// insertIMEI();
}
loading(flag) {

@ -370,16 +370,22 @@ class _Login extends State<Login> {
projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user;
int languageID =
Provider.of<ProjectViewModel>(context, listen: false).isArabic
? 1
: 2;
// GifLoaderDialogUtils.hideDialog(context);
//
// getToDoCount();
//
// Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: LandingPage(),
// ),
// (r) => false);
getToDoCount();
appointmentRateViewModel
.getIsLastAppointmentRatedList(languageID)
.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
.then((value) => {
checkIfIsInPatient(),
getToDoCount(),
// GifLoaderDialogUtils.hideDialog(context),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(

@ -67,7 +67,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
projectViewModel = Provider.of(context);
return BaseView<MyBalanceViewModel>(
onModelReady: (model) {
model.getHospitals(isAdvancePayment: true);
model.getHospitals(projectViewModel.isArabic ? 1 : 2, isAdvancePayment: true);
model.getFamilyFiles();
},
builder: (_, model, w) => AppScaffold(

@ -32,10 +32,11 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
final formKey = GlobalKey<FormState>();
String note = "";
int rating = 0;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
@ -191,18 +192,27 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: DefaultButton(
TranslationBase.of(context).later,
() {
// Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
Navigator.pop(
context,
);
Navigator.pop(
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
// if (projectViewModel.isLoginChild) {
// Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
// } else {
// Navigator.pop(
// context,
// // FadePage(
// // page: LandingPage(),
// // ),
// );
// }
},
color: CustomColors.accentColor,
textColor: Colors.white,
@ -215,9 +225,10 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
rating <= 0
? null
: () {
int languageID = projectViewModel.isArabic ? 1 : 2;
model
.sendAppointmentRate(
rating, widget.appointmentDetails!.appointmentNo!, widget.appointmentDetails!.projectID!, widget.appointmentDetails!.doctorID!, widget.appointmentDetails!.clinicID!, note)
.sendAppointmentRate(rating, widget.appointmentDetails!.appointmentNo!, widget.appointmentDetails!.projectID!, widget.appointmentDetails!.doctorID!,
widget.appointmentDetails!.clinicID!, note, languageID)
.then(
(value) => {
model

@ -193,22 +193,27 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
});
dialog.showAlertDialog(context);
} else {
if(projectViewModel!.isLoginChild) {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
} else {
//changed due to blank page coming before
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
}
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
// if(projectViewModel.isLoginChild) {
// Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
// } else {
// Navigator.pop(
// context,
// // FadePage(
// // page: LandingPage(),
// // ),
// );
// }
}
},
color: CustomColors.accentColor,

@ -33,7 +33,7 @@ class DoctorsListService extends BaseService {
late String tokenID;
List<LaserBodyPart> selectedBodyPartList = [];
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, int languageID, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -73,6 +73,7 @@ class DoctorsListService extends BaseService {
"Longitude": long != null ? long.toString() : 0,
"isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan,
"IsGetNearAppointment": isNearest,
"LanguageID": languageID,
if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()),
"License": true
};
@ -87,7 +88,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorsListByName(String docName, BuildContext context) async {
Future<Map> getDoctorsListByName(String docName, int languageID, BuildContext context) async {
Map<String, dynamic> request;
late double lat;
@ -125,6 +126,7 @@ class DoctorsListService extends BaseService {
"IsGetNearAppointment": false,
"Latitude": lat == null ? 0.0 : lat,
"Longitude": long == null ? 0.0 : long,
"LanguageID": languageID,
"License": true
};
@ -138,7 +140,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async {
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, int languageID, context) async {
Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
@ -157,7 +159,8 @@ class DoctorsListService extends BaseService {
"License": true,
"IsRegistered": true,
"ProjectID": projectID,
"isDentalAllowedBackend": false
"isDentalAllowedBackend": false,
"LanguageID": languageID,
};
dynamic localRes;
@ -604,7 +607,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async {
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -626,7 +629,8 @@ class DoctorsListService extends BaseService {
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"IsComingFromCOC": isForCOC,
"PatientType": authUser.patientType
"PatientType": authUser.patientType,
"LanguageID": languageID
};
dynamic localRes;
@ -1162,7 +1166,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientRadOrders(String appoNo, BuildContext context) async {
Future<Map> getPatientRadOrders(String appoNo, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1182,6 +1186,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType
};
@ -1194,7 +1199,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async {
Future<Map> getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1216,6 +1221,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType
};

@ -36,10 +36,7 @@ class ClinicListService extends BaseService {
Future<Map> getActiveAppointmentNo(context) async {
Map<String, dynamic> request = {};
request = {
"IsActiveAppointment": true,
"LanguageID": 1
};
request = {"IsActiveAppointment": true, "LanguageID": 1};
dynamic localRes;
@ -51,6 +48,21 @@ class ClinicListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getProjectsList(int languageID, context) async {
Map<String, dynamic> request = {};
request = {"LanguageID": languageID};
dynamic localRes;
await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> checkIfInPatientAPI(context) async {
Map<String, dynamic>? request;
request = {
@ -144,9 +156,7 @@ class ClinicListService extends BaseService {
Future<Map> getProjectsList(context) async {
Map<String, dynamic> request = {};
request = {
"LanguageID": null
};
request = {"LanguageID": languageID};
dynamic localRes;
@ -158,7 +168,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async {
Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -177,7 +187,7 @@ class ClinicListService extends BaseService {
"License": true,
// "VersionID": 5.6,
// "Channel": 3,
// "LanguageID": languageID == 'ar' ? 1 : 2,
"LanguageID": languageID,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"SessionID": null,
@ -199,7 +209,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async {
Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, int languageID, BuildContext context, {doctorId}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -219,7 +229,7 @@ class ClinicListService extends BaseService {
"ProjectID": projectID,
// "VersionID": 5.6,
// "Channel": 3,
// "LanguageID": languageID == 'ar' ? 1 : 2,
"LanguageID": languageID,
// "IPAdress": req.IPAdress,
// "generalid": req.generalid,
"SessionID": null,
@ -250,6 +260,13 @@ class ClinicListService extends BaseService {
}, body: request);
return Future.value(localRes);
}
await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> insertInPatientOrder(
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments, context) async {

@ -17,7 +17,7 @@ class LiveCareService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getLivecareClinics(BuildContext context) async {
Future<Map> getLivecareClinics(int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -25,7 +25,12 @@ class LiveCareService extends BaseService {
authUser = data;
}
request = {"Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Gender": authUser.gender != null ? authUser.gender : 0};
request = {
"Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID
};
dynamic localRes;
@ -122,7 +127,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLivecareClinicTiming(int serviceID, BuildContext context) async {
Future<Map> getLivecareClinicTiming(int serviceID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -132,6 +137,7 @@ class LiveCareService extends BaseService {
request = {
"ServiceID": serviceID,
"LanguageID": languageID,
"Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0
@ -355,5 +361,4 @@ class LiveCareService extends BaseService {
}, body: request);
return Future.value(localRes);
}
}

@ -306,6 +306,19 @@ class PushNotificationHandler {
// print("Push Notification getToken: " + token!);
// onToken(token!);
// });
FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) {
print("Push Notification getToken: " + token);
onToken(token);
});
if(Platform.isIOS) {
FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value);
});
}
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
}
newMessage(RemoteMessage remoteMessage) async {

@ -2,6 +2,7 @@ import 'dart:collection';
import 'dart:math';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart';
@ -33,6 +34,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
// import 'package:speech_to_text/speech_recognition_error.dart';
// import 'package:speech_to_text/speech_recognition_result.dart';
// import 'package:speech_to_text/speech_to_text.dart';
@ -44,9 +47,10 @@ class BottomBarSearch extends StatefulWidget {
class _SearchBot extends State<BottomBarSearch> {
SearchProvider searchProvider = new SearchProvider();
RobotProvider Provider = RobotProvider();
RobotProvider robotProvider = RobotProvider();
bool isLoading = false;
bool isError = false;
// final SpeechToText speech = SpeechToText();
String error = '';
String _currentLocaleId = "";
@ -64,6 +68,7 @@ class _SearchBot extends State<BottomBarSearch> {
bool _isInit = true;
TextEditingController searchController = TextEditingController();
ProjectViewModel projectProvider;
@override
void initState() {
@ -74,40 +79,37 @@ class _SearchBot extends State<BottomBarSearch> {
@override
Widget build(BuildContext context) {
projectProvider = Provider.of(context);
return BottomAppBar(
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: SizedBox(
height: 64,
child: Material(
type: MaterialType.transparency,
child: TextField(
keyboardType: TextInputType.multiline,
maxLines: null,
controller: searchController,
decoration: InputDecoration(
hintText: TranslationBase.of(context).textToSpeech,
suffixIcon: IconButton(
icon: Icon(Icons.mic),
onPressed: () async {
setState(() {
searchController.text = '';
});
// await flutterTts.speak("Hello!");
//Future.delayed(const Duration(seconds: 1), () {
initSpeechState()
.then((value) => startVoiceSearch());
//});
},
)),
),
),
child: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
Expanded(
child: SizedBox(
height: 64,
child: Material(
type: MaterialType.transparency,
child: TextField(
keyboardType: TextInputType.multiline,
maxLines: null,
controller: searchController,
decoration: InputDecoration(
hintText: TranslationBase.of(context).textToSpeech,
suffixIcon: IconButton(
icon: Icon(Icons.mic),
onPressed: () async {
setState(() {
searchController.text = '';
});
// await flutterTts.speak("Hello!");
//Future.delayed(const Duration(seconds: 1), () {
initSpeechState().then((value) => startVoiceSearch());
//});
},
)),
),
),
]),
),
),
]),
);
}
@ -164,10 +166,7 @@ class _SearchBot extends State<BottomBarSearch> {
Future<void> initSpeechState() async {
// await speech.initialize(onError: errorListener, onStatus: statusListener);
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
_currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId;
flutterTts.setLanguage(_currentLocaleId);
// if (!mounted) return;
@ -187,16 +186,9 @@ class _SearchBot extends State<BottomBarSearch> {
}
getPages(text) {
var request = {
'VoiceMessage': text,
'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'En'
: 'Ar'
};
searchProvider
.getBotPages(request)
.then((value) => {getCommands(value['Understand'])});
var request = {'VoiceMessage': text, 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'En' : 'Ar'};
searchProvider.getBotPages(request).then((value) => {getCommands(value['Understand'])});
}
getCommands(result) async {
@ -207,9 +199,7 @@ class _SearchBot extends State<BottomBarSearch> {
case '100':
{
List clnicID = unique(result['ClinicId']);
if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length > 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
@ -221,9 +211,7 @@ class _SearchBot extends State<BottomBarSearch> {
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
} else if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
@ -233,9 +221,7 @@ class _SearchBot extends State<BottomBarSearch> {
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
} else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
@ -245,9 +231,7 @@ class _SearchBot extends State<BottomBarSearch> {
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
} else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length > 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
@ -394,12 +378,11 @@ class _SearchBot extends State<BottomBarSearch> {
}
getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) {
int languageID = projectProvider.isArabic ? 1 : 2;
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(doctorId, clinicId, projectId, context)
.then((res) {
service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
@ -407,8 +390,7 @@ class _SearchBot extends State<BottomBarSearch> {
});
}
navigateToDoctorProfile(context, doctorData[0], docProfileList[0],
isAppo: true);
navigateToDoctorProfile(context, doctorData[0], docProfileList[0], isAppo: true);
//speak();
}
}).catchError((err) {
@ -417,33 +399,29 @@ class _SearchBot extends State<BottomBarSearch> {
}
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) {
int languageID = projectProvider.isArabic ? 1 : 2;
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.getDoctorsList(clinicId, projectId, false, context,
doctorId: doctorId, doctorName: doctorName)
.then((res) {
service.getDoctorsList(clinicId, projectId, false, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null &&
res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) {
if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) {
doctorsList.clear();
res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) {
v1['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName!);
arr.add(new DoctorList.fromJson(v).projectName!);
arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters
.toString());
});
});
if (doctorsList.length == 1) {
getDoctorProfile(
projectId, clinicId, doctorId[0], context, doctorsList);
getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList);
//speak();
} else {
@ -454,15 +432,14 @@ class _SearchBot extends State<BottomBarSearch> {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName!);
arr.add(new DoctorList.fromJson(v).projectName!);
arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters
.toString());
});
if (doctorsList.length == 1) {
getDoctorProfile(
projectId, clinicId, doctorId[0], context, doctorsList);
getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList);
//speak();
} else {
@ -479,8 +456,7 @@ class _SearchBot extends State<BottomBarSearch> {
});
}
Future navigateToDoctorProfile(context, docObject, docProfile,
{isAppo}) async {
Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async {
Navigator.push(
context,
FadePage(
@ -497,11 +473,7 @@ class _SearchBot extends State<BottomBarSearch> {
Navigator.push(
context,
FadePage(
page: BranchView(
doctorsList: docList,
result: result,
num: numAll,
resultDistance: arrDistance),
page: BranchView(doctorsList: docList, result: result, num: numAll, resultDistance: arrDistance),
),
);
}

@ -731,10 +731,11 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
}
getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsProfile(doctorId, clinicId, projectId, context).then((res) {
service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
@ -751,12 +752,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
}
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName, isNearest = false}) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName).then((res) {
service.getDoctorsList(clinicId, projectId, isNearest, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

Loading…
Cancel
Save