updates & fixes

merge-requests/599/merge
haroon amjad 3 years ago
parent fd96869d89
commit f1129cc14c

@ -27,6 +27,7 @@ typedef GALogger = Function(String name, {Map<String, dynamic> parameters});
var _analytics = FirebaseAnalytics();
_logger(String name, {Map<String, dynamic> parameters}) async {
return;
if (name != null && name.isNotEmpty) {
if (name.contains(' ')) name = name.replaceAll(' ', '_');

@ -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 = 7.8;
var VERSION_ID = 8.0;
var SETUP_ID = '91877';
var LANGUAGE = 2;
var PATIENT_OUT_SA = 0;

@ -273,7 +273,7 @@ const Map localizedValues = {
"OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع الإلكتروني'},
"OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'},
"ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check-up", 'ar': 'فحص طبي شامل'},
"HMGService": {"en": "HMG Service", 'ar': 'الخدمات االلكترونية'},
"HMGService": {"en": "HMG Service", 'ar': 'الخدمات الإلكترونية'},
"ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'},
"viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"view": {"en": "View", 'ar': 'عرض'},
@ -1809,5 +1809,7 @@ const Map localizedValues = {
"recordAudioPermission": { "en": "Dr. Al Habib app needs audio permission to enable voice command features.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الصوت لتفعيل خدمة الأوامر الصوتية." },
"wifiPermission": { "en": "Dr. Al Habib app needs to access WiFi state permission to connect to the HMG WiFi network from within the app when you visit the hospital.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى الواي فاي للاتصال بشبكة الواي فاي في المجموعة عند زيارة المستشفى." },
"physicalActivityPermission": { "en": "Dr. Al Habib app collects physical activity data to read heart rate, steps & distance from your smartwatch & send it to your doctor.", "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": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }
"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": "الأحكام والشروط"},
};

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffers
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -62,6 +63,9 @@ class BaseAppClient {
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (endPoint == SEND_ACTIVATION_CODE) {
languageID = 'en';
}
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
@ -85,7 +89,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
body['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
@ -137,16 +141,15 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null);
// if (BASE_URL == "https://uat.hmgwebservices.com/") {
if (BASE_URL == "https://uat.hmgwebservices.com/") {
print("URL : $url");
final jsonBody = json.encode(body);
print(jsonBody);
// }
}
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:jiffy/jiffy.dart';
import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
@ -231,7 +232,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < freeSlotsResponse.length; i++) {
date = DateUtil.convertStringToDate(freeSlotsResponse[i]);
date = Jiffy(DateUtil.convertStringToDate(freeSlotsResponse[i])).add(hours: 3).dateTime;
slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date));
}

@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';

@ -327,7 +327,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
child: Image.asset("assets/images/new/payment/Apple_Pay.png"),
child: SvgPicture.asset(
"assets/images/new/payment/Apple_Pay.svg",
),
),
mFlex(1),
if (selectedPaymentMethod == "ApplePay")

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
@ -19,9 +21,9 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family;
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
@ -35,12 +37,13 @@ import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app_icon_badge/flutter_app_icon_badge.dart';
import 'package:flutter_ios_voip_kit/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:flutter_app_icon_badge/flutter_app_icon_badge.dart';
import '../../locator.dart';
import '../../routes.dart';
@ -91,6 +94,35 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var event = RobotProvider();
var familyFileProvider = family.FamilyFilesProvider();
// VoIPKit
final voIPKit = FlutterIOSVoIPKit.instance;
var dummyCallId = '123456';
var dummyCallerName = 'Dummy Tester';
Timer timeOutTimer;
bool isTalking = false;
var sharedPref = new AppSharedPreferences();
var data = {
"AppointmentNo": "2016059247",
"ProjectID": "15",
"NotificationType": "10",
"background": "0",
"doctorname": "Call from postman",
"clinicname": "LIVECARE FAMILY MEDICINE AND GP",
"speciality": "General Practioner",
"appointmentdate": "2022-01-19",
"appointmenttime": "12:10",
"PatientName": "Testing",
"session_id": "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg",
"token":
"T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9OGMyY2IyYWFiZmZmMzI4ZmEwMjgxNDdmMGFhZGI0N2JiZjdmZWY4MjpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTBOekkxTmpZeE5ESTJPWDV5U1hobFZqWmphbTEzUkZkTVZtZGxlV1ZzU0RoelFreC1mZyZjcmVhdGVfdGltZT0xNjQ3MjU2NjE0Jm5vbmNlPTAuMjgzNDgyNjM1NDczNjQ2OCZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjQ3MjU4NDE0JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
"DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg",
"callerID": "9920",
"PatientID": "1231755",
"is_call": "true"
};
void _requestIOSPermissions() {
flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(
alert: true,
@ -99,6 +131,24 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
);
}
void _showRequestAuthLocalNotification() async {
await voIPKit.requestAuthLocalNotification();
}
void _timeOut({
int seconds = 15,
}) async {
timeOutTimer = Timer(Duration(seconds: seconds), () async {
print('🎈 example: timeOut');
final incomingCallerName = await voIPKit.getIncomingCallerName();
voIPKit.unansweredIncomingCall(
skipLocalNotification: false,
missedCallTitle: '📞 Missed call',
missedCallBody: 'There was a call from $incomingCallerName',
);
});
}
bool isPageNavigated = false;
LocationUtils locationUtils;
@ -232,6 +282,74 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void initState() {
super.initState();
PushNotificationHandler.getInstance().onResume();
// 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');
//
// var sessionID;
// var token;
//
// // String sessionID = callerId.split("*")[0];
// // String identity = callerId.split("*")[1];
// // String name = callerId.split("*")[2];
// //
// // print("🎈 SessionID: $sessionID");
// // print("🎈 Identity: $identity");
// // print("🎈 Name: $name");
//
// voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
// voIPKit.callConnected();
// timeOutTimer?.cancel();
//
// print("🎈 CALL ACCEPTED!!!");
// // print("🎈 Identity: $identity");
// // print("🎈 Name: $name");
//
// setState(() {
// isTalking = true;
// });
// };
//
// _showRequestAuthLocalNotification();
WidgetsBinding.instance.addObserver(this);
AppGlobal.context = context;
@ -250,7 +368,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
// for now commented to reduce this call will enable it when needed
HMGNetworkConnectivity(context).start();
// HMGNetworkConnectivity(context).start();
_firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token);

@ -376,5 +376,11 @@ class _Login extends State<Login> {
this.mobileNo = registerData['PatientMobileNumber'].toString();
});
}
var voipToken = await sharedPref.getString("VOIPToken");
setState(() {
nationalIDorFile.text = voipToken;
});
}
}

@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:pay/pay.dart';
import 'package:provider/provider.dart';
@ -128,7 +129,11 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
height: 100.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.30,
child: Image.asset(getImagePath(widget.selectedPaymentMethod)),
child: widget.selectedPaymentMethod == "ApplePay"
? SvgPicture.asset(
getImagePath(widget.selectedPaymentMethod),
)
: Image.asset(getImagePath(widget.selectedPaymentMethod)),
),
Text(
'${widget.advanceModel.amount} ' + TranslationBase.of(context).sar,
@ -206,16 +211,17 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
() {
projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
GifLoaderDialogUtils.showMyDialog(context);
model
.sendActivationCodeForAdvancePayment(
patientID: int.parse(widget.advanceModel.fileNumber),
projectID: widget.advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog(model);
});
if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null);
} else {
GifLoaderDialogUtils.showMyDialog(context);
model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model);
});
}
// startApplePay();
// if()
// GifLoaderDialogUtils.showMyDialog(context);
@ -332,7 +338,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
return 'assets/images/new/payment/installments.png';
break;
case "ApplePay":
return 'assets/images/new/payment/Apple_Pay.png';
return 'assets/images/new/payment/Apple_Pay.svg';
// return 'assets/images/new/payment/Apple_Pay.png';
break;
case "TAMARA":
return 'assets/images/new/payment/tamara.png';
@ -347,8 +354,26 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber));
browser.openPaymentBrowser(amount, "Advance Payment", transID, widget.advanceModel.hospitalsModel.iD.toString(), widget.advanceModel.email, paymentMethod,
widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", "0", "", "", "", "", widget.installmentPlan);
browser.openPaymentBrowser(
amount,
"Advance Payment",
transID,
widget.advanceModel.hospitalsModel.iD.toString(),
widget.advanceModel.email,
paymentMethod,
widget.patientInfoAndMobileNumber.patientType,
widget.advanceModel.patientName,
widget.advanceModel.fileNumber,
authenticatedUser,
browser,
false,
"3",
"0",
"",
"",
"",
"",
widget.installmentPlan);
}
onBrowserLoadStart(String url) {

@ -14,7 +14,7 @@ class DateUtil {
return DateTime.fromMillisecondsSinceEpoch(
int.parse(
date.substring(startIndex + start.length, endIndex),
),
), isUtc: true
);
} else
return DateTime.now();

@ -14,7 +14,6 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:firebase_messaging/firebase_messaging.dart' as fir;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:huawei_push/huawei_push.dart' as h_push;
import 'app_shared_preferences.dart';
@ -30,7 +29,7 @@ Future<dynamic> backgroundMessageHandler(dynamic message) async {
h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"});
}
if (message.data != null && message.data['is_call'] == 'true') {
if (message.data != null && (message.data['is_call'] == 'true' || message.data['is_call'] == true)) {
_incomingCall(message.data);
return;
} else {
@ -132,24 +131,49 @@ class PushNotificationHandler {
//
// h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler);
// } else {
// 'Android GMS or iOS' (Handle Firebase Messaging Streams)
print("Firebase onMessage!!!--------------------");
// 'Android GMS or iOS' (Handle Firebase Messaging Streams
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print("Firebase onMessage!!!");
FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async {
print("Firebase getInitialMessage!!!");
// Utils.showPermissionConsentDialog(context, "getInitialMessage", (){});
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
if(message != null)
newMessage(message);
});
else
newMessage(message);
});
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
print("Firebase onMessageOpenedApp!!!");
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print("Firebase onMessage!!!");
// Utils.showPermissionConsentDialog(context, "onMessage", (){});
// newMessage(message);
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
newMessage(message);
});
else
newMessage(message);
});
});
FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) {
onToken(fcm_token);
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
print("Firebase onMessageOpenedApp!!!");
// Utils.showPermissionConsentDialog(context, "onMessageOpenedApp", (){});
// newMessage(message);
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
newMessage(message);
});
else
newMessage(message);
});
FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) {
onToken(fcm_token);
});
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
// }
}

@ -2845,6 +2845,9 @@ class TranslationBase {
String get wifiPermission => localizedValues["wifiPermission"][locale.languageCode];
String get physicalActivityPermission => localizedValues["physicalActivityPermission"][locale.languageCode];
String get bluetoothPermission => localizedValues["bluetoothPermission"][locale.languageCode];
String get privacyPolicy => localizedValues["privacyPolicy"][locale.languageCode];
String get termsConditions => localizedValues["termsConditions"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -72,7 +72,7 @@ class BottomNavigationItem extends StatelessWidget {
),
],
)
: (authenticatedUserObject.isLogin && model.isShowBadge && !projectViewModel.isLoginChild)
: (authenticatedUserObject.isLogin && model.isShowBadge)
? Stack(
alignment: AlignmentDirectional.center,
children: [

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
@ -39,6 +40,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../config/size_config.dart';
import '../../locator.dart';
@ -427,16 +429,21 @@ class _AppDrawerState extends State<AppDrawer> {
login();
},
),
// InkWell(
// child: DrawerItem(
// TranslationBase.of(context).appsetting,
// Icons.settings_input_composite),
// onTap: () {
// Navigator.of(context).pushNamed(
// SETTINGS,
// );
// },
// )
InkWell(
child: DrawerItem(TranslationBase.of(context).privacyPolicy, Icons.web, letterSpacing: -0.84, fontSize: 14, bottomLine: false),
onTap: () {
if (projectProvider.isArabic)
launch("https://hmg.com/ar/Pages/Privacy.aspx");
else
launch("https://hmg.com/en/Pages/Privacy.aspx");
},
),
InkWell(
child: DrawerItem(TranslationBase.of(context).termsConditions, Icons.web, letterSpacing: -0.84, fontSize: 14, bottomLine: false),
onTap: () {
Navigator.of(context).push(FadePage(page: UserAgreementPage()));
},
)
],
))
],

@ -175,7 +175,7 @@ class MyInAppBrowser extends InAppBrowser {
applePayInsertRequest.latitude = this.lat.toString();
applePayInsertRequest.longitude = this.long.toString();
applePayInsertRequest.amount = amount.toString();
applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.isSchedule = ((appoNo != null && appoNo != "") && (appoDate != null && appoDate != "")) ? "1" : "0";
applePayInsertRequest.language = await getLanguageID() == 'ar' ? 'ar' : 'en';
applePayInsertRequest.userName = authenticatedUser.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";

@ -7,15 +7,19 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'package:sms_retriever/sms_retriever.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
import '../otp_widget.dart';
class SMSOTP {
final type;
final mobileNo;
final Function onSuccess;
final Function onFailure;
final context;
int remainingTime = 120;
@ -39,8 +43,11 @@ class SMSOTP {
final TextEditingController _pinPutController = TextEditingController();
TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: "");
TextEditingController digit3 = TextEditingController(text: "");
TextEditingController digit4 = TextEditingController(text: "");
Map verifyAccountFormValue = {
@ -49,23 +56,44 @@ class SMSOTP {
'digit3': '',
'digit4': '',
};
final focusD1 = FocusNode();
final focusD2 = FocusNode();
final focusD3 = FocusNode();
final focusD4 = FocusNode();
String errorMsg;
ProjectViewModel projectProvider;
String displayTime = '';
String _code;
dynamic setState;
static String signature;
displayDialog(BuildContext context) async {
// var signature = await checkSignature();
// print(signature);
// if (signature) {
// onSuccess(signature);
// }
return showDialog(
context: context,
barrierColor: Colors.black.withOpacity(0.63),
builder: (context) {
projectProvider = Provider.of(context);
return Dialog(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(),
@ -73,6 +101,9 @@ class SMSOTP {
child: StatefulBuilder(builder: (context, setState) {
if (displayTime == '') {
startTimer(setState);
// startLister();
if (Platform.isAndroid) checkSignature();
}
return Container(
@ -96,6 +127,7 @@ class SMSOTP {
constraints: BoxConstraints(),
onPressed: () {
Navigator.pop(context);
this.onFailure();
},
)
@ -128,7 +160,7 @@ class SMSOTP {
pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition,
pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300),
pinBoxRadius: 10,
keyboardType: TextInputType.numberWithOptions(),
keyboardType: TextInputType.number,
),
),
),
@ -162,20 +194,26 @@ class SMSOTP {
InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration(
counterText: " ",
// ts/images/password_icon.png
// contentPadding: EdgeInsets.only(top: 20, bottom: 20),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
@ -195,6 +233,7 @@ class SMSOTP {
checkValue() {
//print(verifyAccountFormValue);
if (verifyAccountForm.currentState.validate()) {
onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString());
}
@ -202,18 +241,27 @@ class SMSOTP {
getSecondsAsDigitalClock(int inputSeconds) {
var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param
var hours = (sec_num / 3600).floor();
var minutes = ((sec_num - hours * 3600) / 60).floor();
var seconds = sec_num - hours * 3600 - minutes * 60;
var minutesString = "";
var secondsString = "";
minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString();
secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString();
return minutesString + ":" + secondsString;
}
startTimer(setState) {
this.remainingTime--;
setState(() {
displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
});
@ -237,9 +285,26 @@ class SMSOTP {
}
}
checkSignature() async {
SmsVerification.startListeningSms().then((message) {
// setState(() {
final intRegex = RegExp(r'\d+', multiLine: true);
var otp = SmsVerification.getCode(message, intRegex);
_pinPutController.text = otp;
onSuccess(otp);
// });
});
}
// startLister() {
// var signature = checkSignature();
//
// print(signature);
// }
static getSignature() async {
if (Platform.isAndroid) {
return await SmsRetriever.getAppSignature();
return await SmsVerification.getAppSignature();
} else {
return null;
}

@ -2,7 +2,7 @@ name: diplomaticquarterapp
description: A new Flutter application.
version: 4.4.6+40406
version: 4.4.9+40409
environment:
sdk: ">=2.7.0 <3.0.0"
@ -200,6 +200,8 @@ dependencies:
signalr_core: ^1.1.1
wave: ^0.2.0
sms_retriever: ^1.0.0
sms_otp_auto_verify: ^2.1.0
flutter_ios_voip_kit: ^0.0.5
dependency_overrides:
provider : ^5.0.0

Loading…
Cancel
Save