Updates & fixes

merge-update-with-lab-changes
haroon amjad 4 years ago
parent 842e099953
commit 9057a96d7f

@ -25,7 +25,7 @@ var BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
//
// // Pharmacy Production URLs // // Pharmacy Production URLs
var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
@ -395,7 +395,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 8.2; var VERSION_ID = 8.3;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
var PATIENT_OUT_SA = 0; var PATIENT_OUT_SA = 0;

@ -541,7 +541,7 @@ const Map localizedValues = {
"refferal": {"en": "E-Refferal", "ar": "الإحالة الإلكترونية"}, "refferal": {"en": "E-Refferal", "ar": "الإحالة الإلكترونية"},
"refferalTitle": {"en": "E-Refferal", "ar": "خدمات"}, "refferalTitle": {"en": "E-Refferal", "ar": "خدمات"},
"refferalSubTitle": {"en": "Service", "ar": "الإحالة الإلكترونية"}, "refferalSubTitle": {"en": "Service", "ar": "الإحالة الإلكترونية"},
"healthCare": {"en": "Health Care", "ar": "الصحية المزلية"}, "healthCare": {"en": "Health Care", "ar": "الصحية المنزلية"},
"emergency": {"en": "Emergency", "ar": "الطوارئ"}, "emergency": {"en": "Emergency", "ar": "الطوارئ"},
"erservices": {"en": "Emergency", "ar": "الطوارئ"}, "erservices": {"en": "Emergency", "ar": "الطوارئ"},
"services2": {"en": "Services", "ar": "خدمات"}, "services2": {"en": "Services", "ar": "خدمات"},
@ -1812,4 +1812,5 @@ const Map localizedValues = {
"bluetoothPermission": { "en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }, "bluetoothPermission": { "en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." },
"privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"}, "privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"},
"termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"},
"liveCarePermissions": {"en": "LiveCare required Camera & Microphone permissions, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون ، يرجى السماح لها بالمتابعة."},
}; };

@ -2,6 +2,7 @@ const TOKEN = 'token';
const APP_LANGUAGE = 'language'; const APP_LANGUAGE = 'language';
const USER_PROFILE = 'user-profile'; const USER_PROFILE = 'user-profile';
const PUSH_TOKEN = 'push-token'; const PUSH_TOKEN = 'push-token';
const APNS_TOKEN = 'apns-token';
const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register'; const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register';
const LOGIN_TOKEN_ID = 'register-data-for-register'; const LOGIN_TOKEN_ID = 'register-data-for-register';
const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login'; const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login';

@ -132,7 +132,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 2076117163; // body['IdentificationNo'] = 2076117163;
// body['MobileNo'] = "966503109207"; // body['MobileNo'] = "966503109207";
// body['PatientID'] = 793807; //3844083 // body['PatientID'] = 3569409; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -488,7 +488,7 @@ class BaseAppClient {
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
'Host': "mdlaboratories.com", // 'Host': "mdlaboratories.com",
}); });
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");

@ -74,7 +74,7 @@ class _MyApp extends State<MyApp> {
// var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans';
// Re-enable once going live // Re-enable once going live
// if (Platform.isAndroid) checkForUpdate(); if (Platform.isAndroid) checkForUpdate();
ThemeNotifier(defaultTheme()); ThemeNotifier(defaultTheme());
super.initState(); super.initState();

@ -230,8 +230,6 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
Map<DateTime, List> _eventsParsed; Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = []; List<FreeSlot> slotsList = [];
DateTime date; DateTime date;
// print("TIMEZONE");
// print(DateTime.now().timeZoneName);
final DateFormat formatter = DateFormat('HH:mm'); final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < freeSlotsResponse.length; i++) { for (var i = 0; i < freeSlotsResponse.length; i++) {

@ -534,7 +534,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: LiveCareBookAppointment(clinicName: "Family Medicine", liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]), page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]),
), ),
).then((value) { ).then((value) {
setState(() { setState(() {

@ -198,7 +198,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
// if (projectViewModel.havePrivilege(90)) if (projectViewModel.havePrivilege(90))
// Container( // Container(
// width: double.infinity, // width: double.infinity,
// child: InkWell( // child: InkWell(

@ -1,6 +1,8 @@
import 'dart:convert';
import 'dart:math' as math; import 'dart:math' as math;
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:crypto/crypto.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -23,9 +25,8 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:payfort_plugin/payfort_plugin.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pay/pay.dart';
class HomePageFragment2 extends StatefulWidget { class HomePageFragment2 extends StatefulWidget {
DashboardViewModel model; DashboardViewModel model;
@ -102,7 +103,23 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
onLoginClick: () { onLoginClick: () {
widget.onLoginClick(); widget.onLoginClick();
projectViewModel.analytics.loginRegistration.login_register_initiate(); projectViewModel.analytics.loginRegistration.login_register_initiate();
// navigateTo(context, CallHomePage());
// var output;
// PayfortPlugin.getID.then((deviceID) {
// //use this deviceID to send it to your server to get YOR_MERCHANT_REF and YOUR_SDK_TOKEN
// print("DeviceID: $deviceID");
// output = sha256
// .convert(
// utf8.encode("asD123@saereaccess_code=BsM6He4FMBaZ86W64kjZdevice_id=" + deviceID + "language=enmerchant_identifier=ipxnRXXqservice_command=SDK_TOKENasD123@saere"))
// .toString();
// print("signature: $output");
// PayfortPlugin.performPaymentRequest('ipxnRXXq', '099529edbf88418e92a0cb915eba0f3b', 'ahmed', 'en', 'haroon6138@mail.com', '10000', 'PURCHASE', 'SAR', '0' // 0 for test mode and 1 for production
// )
// .then((value) => {
// // value object contains payfort response, such card number, transaction reference, ...
// print("card number ${value["card_number"]}")
// });
// });
}, },
), ),
// height: MediaQuery.of(context).size.width / 2.6, // height: MediaQuery.of(context).size.width / 2.6,
@ -288,8 +305,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
onTap: () { onTap: () {
projectViewModel.analytics.offerPackages.log(); projectViewModel.analytics.offerPackages.log();
AuthenticatedUser user = projectViewModel.user; AuthenticatedUser user = projectViewModel.user;
if(projectViewModel.havePrivilege(82)) if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user)));
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user)));
}, },
child: Stack( child: Stack(
children: [ children: [

@ -1,13 +1,18 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -41,7 +46,6 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
description: TranslationBase.of(context).erConsultation, description: TranslationBase.of(context).erConsultation,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
child: Column( child: Column(
children: [ children: [
@ -257,8 +261,6 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: getPaymentMethods(), child: getPaymentMethods(),
), ),
], ],
), ),
), ),
@ -272,7 +274,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
() { () {
Navigator.pop(context, false); Navigator.pop(context, false);
}, },
), ),
@ -281,12 +283,18 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
() { () {
if (_selected == 0) { if (_selected == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
} else { } else {
projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); askVideoCallPermission().then((value) {
Navigator.pop(context, true); if (value) {
projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName);
Navigator.pop(context, true);
} else {
openPermissionsDialog();
}
});
} }
}, },
color: CustomColors.green, color: CustomColors.green,
@ -301,6 +309,46 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
); );
} }
Future<bool> askVideoCallPermission() async {
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) {
return false;
}
if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) {
await drawOverAppsMessageDialog(context).then((value) {
return false;
});
}
return true;
}
openPermissionsDialog() {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).liveCarePermissions,
okText: TranslationBase.of(context).settings,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
openAppSettings();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
Future drawOverAppsMessageDialog(BuildContext context) async {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).drawOverAppsPermission,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
await PlatformBridge.shared().askDrawOverAppsPermission();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
void onRadioChanged(int value) { void onRadioChanged(int value) {
setState(() { setState(() {
_selected = value; _selected = value;

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
@ -5,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingReque
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -31,12 +33,13 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
ErRequestHistoryList pendingERRequestHistoryList; ErRequestHistoryList pendingERRequestHistoryList;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this); _tabController = new TabController(length: 2, vsync: this);
erRequestHistoryList = List(); erRequestHistoryList = List();
LiveCareHome.isLiveCareTypeSelected = false;
pendingERRequestHistoryList = new ErRequestHistoryList(); pendingERRequestHistoryList = new ErRequestHistoryList();
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_ar/ar/0.png')); imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_ar/ar/0.png'));
@ -47,6 +50,13 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
super.initState(); super.initState();
} }
@override
void dispose() {
LiveCareHome.isLiveCareTypeSelected = false;
sharedPref.remove(LIVECARE_CLINIC_DATA);
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);

@ -59,7 +59,7 @@ class _clinic_listState extends State<ClinicList> {
var languageID; var languageID;
var currentSelectedLiveCareType; var currentSelectedLiveCareType;
int selectedClinicID = 1; int selectedClinicID;
String selectedClinicName = "-"; String selectedClinicName = "-";
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@ -190,15 +190,21 @@ class _clinic_listState extends State<ClinicList> {
navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName)).then( navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName)).then(
(value) { (value) {
if (value) { if (value) {
askVideoCallPermission().then((value) { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
if (value) { addNewCallForPatientER(projectViewModel.user.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString());
if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { } else {
addNewCallForPatientER(projectViewModel.user.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString()); navigateToPaymentMethod(getERAppointmentFeesList, context);
} else { }
navigateToPaymentMethod(getERAppointmentFeesList, context);
} // askVideoCallPermission().then((value) {
} // if (value) {
}); // if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
// addNewCallForPatientER(projectViewModel.user.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString());
// } else {
// navigateToPaymentMethod(getERAppointmentFeesList, context);
// }
// }
// });
} }
}, },
); );
@ -328,8 +334,6 @@ class _clinic_listState extends State<ClinicList> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo));
@ -380,9 +384,13 @@ class _clinic_listState extends State<ClinicList> {
liveCareOfflineClinicsListResponse.add(clinic); liveCareOfflineClinicsListResponse.add(clinic);
} }
}); });
if(liveCareClinicIDs != null) {
selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID; selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]);
selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceName; selectedClinicName = liveCareClinicIDs.split("-")[0];
} else {
selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID;
selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceName;
}
isDataLoaded = true; isDataLoaded = true;
}); });
} else { } else {

@ -377,10 +377,10 @@ class _Login extends State<Login> {
}); });
} }
var voipToken = await sharedPref.getString("VOIPToken"); // var voipToken = await sharedPref.getString("VOIPToken");
setState(() { // setState(() {
nationalIDorFile.text = voipToken; // nationalIDorFile.text = voipToken;
}); // });
} }
} }

@ -44,7 +44,7 @@ class ViewDoctorResponsesPage extends StatelessWidget {
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
return Container( return Container(
padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12), padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12),
height: 110, height: 130,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
@ -86,7 +86,7 @@ class ViewDoctorResponsesPage extends StatelessWidget {
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
doctorResponse.transactions[_index]['DoctorResponse'], doctorResponse.transactions[_index]['InfoStatusDescription'],
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xff2E303A), color: Color(0xff2E303A),

@ -33,11 +33,7 @@ class AskDoctorPage extends StatelessWidget {
return Container( return Container(
margin: EdgeInsets.only(left: 50.0, right: 50.0), margin: EdgeInsets.only(left: 50.0, right: 50.0),
child: Center( child: Center(
child: Text(TranslationBase.of(context).askDocEmpty, textAlign: TextAlign.center, style: TextStyle( child: Text(TranslationBase.of(context).askDocEmpty, textAlign: TextAlign.center, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: CustomColors.accentColor)),
fontSize: 14,
fontWeight: FontWeight.w400,
color: CustomColors.accentColor
)),
), ),
); );
} }
@ -81,23 +77,20 @@ class AskDoctorPage extends StatelessWidget {
return DoctorView( return DoctorView(
doctor: doctorList, doctor: doctorList,
isLiveCareAppointment: false, isLiveCareAppointment: false,
isShowFlag: false,
onTap: () { onTap: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) { service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['ErrorEndUserMessage'] == null) { Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: RequestTypePage(doctorList: _doctor),
page: RequestTypePage(doctorList: _doctor), ),
), );
);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (err != null) AppToast.showErrorToast(message: err); if (err != null) AppToast.showErrorToast(message: err.toString());
print(err); print(err);
}); });
}, },

@ -71,7 +71,7 @@ class DoctorResponse extends StatelessWidget {
); );
}, },
child: Container( child: Container(
height: 75, height: 100,
margin: EdgeInsets.only(top: 8, bottom: 8), margin: EdgeInsets.only(top: 8, bottom: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -101,8 +101,8 @@ class DoctorResponse extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Icon(projectViewModel.isArabic child: Icon(projectViewModel.isArabic
? Icons.arrow_back_ios ? Icons.arrow_forward_ios
: Icons.arrow_forward_ios), : Icons.arrow_back_ios),
) )
], ],
), ),
@ -144,7 +144,7 @@ class DoctorResponse extends StatelessWidget {
return InkWell( return InkWell(
onTap: () {}, onTap: () {},
child: Container( child: Container(
height: 70, height: 85,
margin: EdgeInsets.only(top: 8, bottom: 8), margin: EdgeInsets.only(top: 8, bottom: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -171,9 +171,12 @@ class DoctorResponse extends StatelessWidget {
), ),
), ),
), ),
Icon(projectViewModel.isArabic Padding(
? Icons.arrow_forward padding: const EdgeInsets.all(8.0),
: Icons.arrow_back_ios) child: Icon(projectViewModel.isArabic
? Icons.arrow_forward_ios
: Icons.arrow_back_ios),
)
], ],
), ),
), ),

@ -221,7 +221,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
}); });
} }
// startApplePay(); // startApplePay();
// if() // if()
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
@ -238,7 +237,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
} }
startApplePay() { startApplePay() {
// GifLoaderDialogUtils.showMyDialog(context);
ApplePayResponse applePayResponse; ApplePayResponse applePayResponse;
var _paymentItems = [ var _paymentItems = [
PaymentItem( PaymentItem(

@ -384,10 +384,9 @@ class PrescriptionItemsPage extends StatelessWidget {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).resendOrder, TranslationBase.of(context).resendOrder,
// ((!projectViewModel.havePrivilege(62)) || projectViewModel.user.outSA == 1 || model.isMedDeliveryAllowed == false) model.isMedDeliveryAllowed == false
// ? null ? null
// : : () => {
() => {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -51,14 +51,14 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (await PermissionService.isHealthDataPermissionEnabled()) { if (await PermissionService.isHealthDataPermissionEnabled()) {
await health.requestAuthorization(types).then((value) { await health.requestAuthorization(types).then((value) {
if(value) { if (value) {
readAll(); readAll();
} }
}); });
} else { } else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).physicalActivityPermission, () async { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).physicalActivityPermission, () async {
await health.requestAuthorization(types).then((value) { await health.requestAuthorization(types).then((value) {
if(value) { if (value) {
readAll(); readAll();
} }
}); });
@ -66,7 +66,7 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
} }
} else { } else {
await health.requestAuthorization(types).then((value) { await health.requestAuthorization(types).then((value) {
if(value) { if (value) {
readAll(); readAll();
} }
}); });
@ -82,8 +82,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
Med_InsertTransactionsInputsList.clear(); Med_InsertTransactionsInputsList.clear();
DateTime startDate = DateTime.now().subtract(new Duration(days: 30)); DateTime startDate = DateTime.now().subtract(new Duration(days: 30));
await checkPermissions();
try { try {
List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, DateTime.now(), types); List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, DateTime.now(), types);
_healthDataList.addAll(healthData); _healthDataList.addAll(healthData);

@ -201,6 +201,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
String deviceToken; String deviceToken;
String voipToken = await sharedPref.getString(APNS_TOKEN);
getDeviceToken().then((value) { getDeviceToken().then((value) {
print(value); print(value);
deviceToken = value; deviceToken = value;
@ -215,7 +216,7 @@ class LiveCareService extends BaseService {
"ErServiceID": serviceID, "ErServiceID": serviceID,
"ClientRequestID": clientRequestID, "ClientRequestID": clientRequestID,
"DeviceToken": deviceToken, "DeviceToken": deviceToken,
"VoipToken": "", "VoipToken": voipToken,
"IsFlutter": true, "IsFlutter": true,
"Latitude": await this.sharedPref.getDouble(USER_LAT), "Latitude": await this.sharedPref.getDouble(USER_LAT),
"Longitude": await this.sharedPref.getDouble(USER_LONG), "Longitude": await this.sharedPref.getDouble(USER_LONG),

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:ui'; import 'dart:ui';
import 'package:device_calendar/device_calendar.dart'; import 'package:device_calendar/device_calendar.dart';
import 'package:timezone/timezone.dart';
final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin();
@ -52,8 +53,17 @@ class CalendarUtils {
// daysOfWeek: daysOfWeek, // daysOfWeek: daysOfWeek,
endDate: scheduleDateTime, endDate: scheduleDateTime,
); );
Location _currentLocation;
if (DateTime.now().timeZoneName == "+04")
_currentLocation = getLocation('Asia/Dubai');
else
_currentLocation = getLocation('Asia/Riyadh');
TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime, _currentLocation);
print("eventId " + eventId); print("eventId " + eventId);
Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: scheduleDateTime, end: scheduleDateTime.add(Duration(minutes: 30)), title: title, description: description); Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description);
deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) {
print("catchError " + e.toString()); print("catchError " + e.toString());
}).whenComplete(() { }).whenComplete(() {

@ -7,7 +7,7 @@ class DateUtil {
static DateTime convertStringToDate(String date) { static DateTime convertStringToDate(String date) {
if (date != null) { if (date != null) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)/"; const end = "+0300)";
final startIndex = date.indexOf(start); final startIndex = date.indexOf(start);
final endIndex = date.indexOf(end, startIndex + start.length); final endIndex = date.indexOf(end, startIndex + start.length);
return DateTime.fromMillisecondsSinceEpoch( return DateTime.fromMillisecondsSinceEpoch(

@ -151,70 +151,77 @@ class PushNotificationHandler {
init() async { init() async {
// VoIP Callbacks // VoIP Callbacks
// voIPKit.getVoIPToken().then((value) { voIPKit.getVoIPToken().then((value) {
// print('🎈 example: getVoIPToken: $value'); print('🎈 example: getVoIPToken: $value');
// // sharedPref.setString("VOIPToken", value); AppSharedPreferences().setString(APNS_TOKEN, value);
// }); });
//
// voIPKit.onDidReceiveIncomingPush = ( voIPKit.onDidUpdatePushToken = (
// Map<String, dynamic> payload, String token,
// ) async { ) {
// print('🎈 example: onDidReceiveIncomingPush $payload'); print('🎈 example: onDidUpdatePushToken: $token');
// _timeOut(); AppSharedPreferences().setString(APNS_TOKEN, token);
// }; };
//
// voIPKit.onDidRejectIncomingCall = ( voIPKit.onDidReceiveIncomingPush = (
// String uuid, Map<String, dynamic> payload,
// String callerId, ) async {
// ) { print('🎈 example: onDidReceiveIncomingPush $payload');
// if (isTalking) { _timeOut();
// return; };
// }
// voIPKit.onDidRejectIncomingCall = (
// print('🎈 example: onDidRejectIncomingCall $uuid, $callerId'); String uuid,
// voIPKit.endCall(); String callerId,
// timeOutTimer?.cancel(); ) {
// if (isTalking) {
// // setState(() { return;
// // isTalking = false; }
// // });
// }; print('🎈 example: onDidRejectIncomingCall $uuid, $callerId');
// voIPKit.endCall();
// voIPKit.onDidAcceptIncomingCall = ( timeOutTimer?.cancel();
// String uuid,
// String callerId, // setState(() {
// ) { // isTalking = false;
// // print('🎈 example: isTalking $isTalking'); // });
// // if (isTalking) { };
// // return;
// // } voIPKit.onDidAcceptIncomingCall = (
// String uuid,
// print('🎈 example: onDidAcceptIncomingCall $uuid, $callerId'); String callerId,
// ) {
// String sessionID = callerId.split("*")[0]; // print('🎈 example: isTalking $isTalking');
// String token = callerId.split("*")[1]; // if (isTalking) {
// // return;
// print("🎈 SessionID: $sessionID"); // }
// print("🎈 Token: $token");
// print('🎈 example: onDidAcceptIncomingCall $uuid, $callerId');
// voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
// voIPKit.callConnected(); String sessionID = callerId.split("*")[0];
// timeOutTimer?.cancel(); String token = callerId.split("*")[1];
//
// print("🎈 CALL ACCEPTED!!!"); print("🎈 SessionID: $sessionID");
// print("🎈 Token: $token");
// Future.delayed(new Duration(milliseconds: 1000)).then((value) async {
// print("🎈 Incoming Call!!!"); voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
// callPage(sessionID, token); voIPKit.callConnected();
// }); timeOutTimer?.cancel();
//
// // print("🎈 Identity: $identity"); print("🎈 CALL ACCEPTED!!!");
// // print("🎈 Name: $name");
// Future.delayed(new Duration(milliseconds: 2000)).then((value) async {
// // setState(() { print("🎈 Incoming Call!!!");
// // isTalking = true; callPage(sessionID, token);
// // }); });
// };
// print("🎈 Identity: $identity");
// print("🎈 Name: $name");
// setState(() {
// isTalking = true;
// });
};
if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) {
final fcmToken = await FirebaseMessaging.instance.getToken(); final fcmToken = await FirebaseMessaging.instance.getToken();

@ -2847,6 +2847,7 @@ class TranslationBase {
String get bluetoothPermission => localizedValues["bluetoothPermission"][locale.languageCode]; String get bluetoothPermission => localizedValues["bluetoothPermission"][locale.languageCode];
String get privacyPolicy => localizedValues["privacyPolicy"][locale.languageCode]; String get privacyPolicy => localizedValues["privacyPolicy"][locale.languageCode];
String get termsConditions => localizedValues["termsConditions"][locale.languageCode]; String get termsConditions => localizedValues["termsConditions"][locale.languageCode];
String get liveCarePermissions => localizedValues["liveCarePermissions"][locale.languageCode];
} }

@ -165,7 +165,7 @@ class Utils {
} }
String loginIDPattern(loginType) { String loginIDPattern(loginType) {
var length = loginType == 1 ? 10 : 4; var length = loginType == 1 ? 10 : 1;
return "([0-9]{" + length.toString() + "})"; return "([0-9]{" + length.toString() + "})";
} }

@ -24,13 +24,14 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
crossPlatform: InAppBrowserOptions(hideUrlBar: true), crossPlatform: InAppBrowserOptions(hideUrlBar: true),
ios: IOSInAppBrowserOptions( ios: IOSInAppBrowserOptions(
hideToolbarBottom: false, hideToolbarBottom: false,
toolbarBottomBackgroundColor: Colors.white,
)); ));
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
@ -247,6 +248,7 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PATIENT_OUT_SA', authUser.outSA == 0 ? false.toString() : true.toString()); form = form.replaceFirst('PATIENT_OUT_SA', authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst('PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1"); form = form.replaceFirst('PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
// form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN) + "," + await sharedPref.getString(APNS_TOKEN));
form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString()); form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString()); form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());

Loading…
Cancel
Save