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
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
//
// // Pharmacy Production URLs
var BASE_PHARMACY_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 GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 8.2;
var VERSION_ID = 8.3;
var SETUP_ID = '91877';
var LANGUAGE = 2;
var PATIENT_OUT_SA = 0;

@ -541,7 +541,7 @@ const Map localizedValues = {
"refferal": {"en": "E-Refferal", "ar": "الإحالة الإلكترونية"},
"refferalTitle": {"en": "E-Refferal", "ar": "خدمات"},
"refferalSubTitle": {"en": "Service", "ar": "الإحالة الإلكترونية"},
"healthCare": {"en": "Health Care", "ar": "الصحية المزلية"},
"healthCare": {"en": "Health Care", "ar": "الصحية المنزلية"},
"emergency": {"en": "Emergency", "ar": "الطوارئ"},
"erservices": {"en": "Emergency", "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": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." },
"privacyPolicy": {"en": "Privacy Policy", "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 USER_PROFILE = 'user-profile';
const PUSH_TOKEN = 'push-token';
const APNS_TOKEN = 'apns-token';
const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register';
const LOGIN_TOKEN_ID = 'register-data-for-register';
const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login';

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

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

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

@ -534,7 +534,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Navigator.push(
context,
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) {
setState(() {

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

@ -1,6 +1,8 @@
import 'dart:convert';
import 'dart:math' as math;
import 'package:auto_size_text/auto_size_text.dart';
import 'package:crypto/crypto.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_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:flutter/material.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:pay/pay.dart';
class HomePageFragment2 extends StatefulWidget {
DashboardViewModel model;
@ -102,7 +103,23 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
onLoginClick: () {
widget.onLoginClick();
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,
@ -288,8 +305,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
onTap: () {
projectViewModel.analytics.offerPackages.log();
AuthenticatedUser user = projectViewModel.user;
if(projectViewModel.havePrivilege(82))
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user)));
if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user)));
},
child: Stack(
children: [

@ -1,13 +1,18 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@ -41,7 +46,6 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
description: TranslationBase.of(context).erConsultation,
body: Container(
width: double.infinity,
height: double.infinity,
child: Column(
children: [
@ -257,8 +261,6 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: getPaymentMethods(),
),
],
),
),
@ -272,7 +274,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel,
() {
() {
Navigator.pop(context, false);
},
),
@ -281,12 +283,18 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
() {
() {
if (_selected == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
} else {
projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName);
Navigator.pop(context, true);
askVideoCallPermission().then((value) {
if (value) {
projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName);
Navigator.pop(context, true);
} else {
openPermissionsDialog();
}
});
}
},
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) {
setState(() {
_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/viewModels/project_view_model.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/livecare_logs.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -31,12 +33,13 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
ErRequestHistoryList pendingERRequestHistoryList;
ProjectViewModel projectViewModel;
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this);
erRequestHistoryList = List();
LiveCareHome.isLiveCareTypeSelected = false;
pendingERRequestHistoryList = new ErRequestHistoryList();
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'));
@ -47,6 +50,13 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
super.initState();
}
@override
void dispose() {
LiveCareHome.isLiveCareTypeSelected = false;
sharedPref.remove(LIVECARE_CLINIC_DATA);
super.dispose();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);

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

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

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

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

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

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

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

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

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

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:ui';
import 'package:device_calendar/device_calendar.dart';
import 'package:timezone/timezone.dart';
final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin();
@ -52,8 +53,17 @@ class CalendarUtils {
// daysOfWeek: daysOfWeek,
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);
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) {
print("catchError " + e.toString());
}).whenComplete(() {

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

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

@ -2847,6 +2847,7 @@ class TranslationBase {
String get bluetoothPermission => localizedValues["bluetoothPermission"][locale.languageCode];
String get privacyPolicy => localizedValues["privacyPolicy"][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) {
var length = loginType == 1 ? 10 : 4;
var length = loginType == 1 ? 10 : 1;
return "([0-9]{" + length.toString() + "})";
}

@ -24,13 +24,14 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
crossPlatform: InAppBrowserOptions(hideUrlBar: true),
ios: IOSInAppBrowserOptions(
hideToolbarBottom: false,
toolbarBottomBackgroundColor: Colors.white,
));
class MyInAppBrowser extends InAppBrowser {
_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/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// 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 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_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('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());

Loading…
Cancel
Save