Tamara & Apple Pay Fixes + Other Updates

development_v2.5
haroon amjad 2 years ago
parent 8be9d3ae6e
commit 58a6dc6a6f

@ -42,9 +42,9 @@ _logger(String name, {Map<String, dynamic> parameters}) async {
try {
_analytics.logEvent(name: name.trim().toLowerCase(), parameters: parameters).then((value) {
debugPrint('SUCCESS: Google analytics event "$name" sent with parameters $parameters');
// debugPrint('SUCCESS: Google analytics event "$name" sent with parameters $parameters');
}).catchError((error) {
debugPrint('ERROR: Google analytics event "$name" sent failed');
// debugPrint('ERROR: Google analytics event "$name" sent failed');
});
} catch (e) {
print(e);

@ -384,6 +384,9 @@ var APPLE_PAY_INSERT_REQUEST =
'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
var GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
var TAMARA_REQUEST_INSERT = 'Services/PayFort_Serv.svc/REST/AddTamaraRequest';
var UPDATE_HEALTH_TERMS =
'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
@ -405,19 +408,20 @@ 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.7;
var VERSION_ID = 8.8;
var SETUP_ID = '91877';
var LANGUAGE = 2;
var PATIENT_OUT_SA = 0;
// var PATIENT_OUT_SA = 0;
var SESSION_ID = 'TMRhVmkGhOsvamErw';
var IS_DENTAL_ALLOWED_BACKEND = false;
var PATIENT_TYPE = 1;
var PATIENT_TYPE_ID = 1;
// var PATIENT_TYPE = 1;
// var PATIENT_TYPE_ID = 1;
var DEVICE_TOKEN = "";
var IS_VOICE_COMMAND_CLOSED = true;
var IS_TEXT_COMPLETED = false;
var DeviceTypeID = Platform.isIOS ? 1 : 2;
var LANGUAGE_ID = 2;
// var DeviceTypeID = Platform.isIOS ? 1 : 2;
// var LANGUAGE_ID = 2;
var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var GET_PAtIENTS_INSURANCE =
@ -727,6 +731,15 @@ var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL =
var GET_TAMARA_PLAN =
'https://mdlaboratories.com/tamara/Home/GetInstallments';
var UPDATE_TAMARA_STATUS =
'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus';
var MARK_APPOINTMENT_TAMARA_STATUS =
'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida';
var AUTO_GENERATE_INVOICE_TAMARA =
'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice';
var GET_ONESIGNAL_VOIP_TOKEN =
'https://onesignal.com/api/v1/players';
@ -735,6 +748,9 @@ class AppGlobal {
AppSharedPreferences sharedPref = AppSharedPreferences();
static bool isNetworkDebugEnabled = false;
static String appLanguage = "";
Request getPublicRequest() {
Request request = new Request();
request.Channel = 3;

@ -1847,7 +1847,8 @@ const Map localizedValues = {
"lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" },
"lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" },
"lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" },
"deleteAccount": { "en": "Deactivate my account", "ar": "الحساب احذف" },
"deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد إلغاء تنشيط حسابك؟" },
"accountDeactivated": { "en": "Your account has been deactivated successfully", "ar": "تم إلغاء تنشيط حسابك بنجاح" },
"deleteAccount": { "en": "Deactivate Account", "ar": "ايقاف الحساب مؤقتاً" },
"deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد ايقاف الحساب مؤقتاً حسابك؟" },
"accountDeactivated": { "en": "Your account has been deactivated successfully", "ar": "تم ايقاف الحساب مؤقتاً بنجاح." },
"accountDeactivatedMsg": { "en": "Your account has been deactivated. Would you like to reactivate it?", "ar": "حسابك معطل. هل ترغب في إعادة تنشيطه مرة أخرى؟" },
};

@ -55,7 +55,6 @@ class BaseAppClient {
url = BASE_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
@ -96,16 +95,17 @@ class BaseAppClient {
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
: null
: null;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
: null
: null;
if (user != null) {
body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
@ -113,8 +113,8 @@ class BaseAppClient {
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
: user['OutSA']
: user['OutSA'];
body['SessionID'] = getSessionId(body['TokenID']); //getSe
headers = {
@ -130,8 +130,8 @@ class BaseAppClient {
}
// body['IdentificationNo'] = 1098574195;
// body['MobileNo'] = "966565001080";
// body['PatientID'] = 3235660; //3844083
// body['MobileNo'] = "537503378";
// body['PatientID'] = 1231755; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
@ -140,11 +140,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null);
if (BASE_URL == "https://uat.hmgwebservices.com/") {
debugPrint("URL : $url");
// if (AppGlobal.isNetworkDebugEnabled) {
print("URL : $url");
final jsonBody = json.encode(body);
debugPrint(jsonBody);
}
print(jsonBody);
// }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
@ -731,8 +731,8 @@ class BaseAppClient {
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
: user['OutSA']
: user['OutSA'];
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
@ -750,21 +750,21 @@ class BaseAppClient {
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
: user['PatientType']
: user['PatientType'];
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
: user['PatientType']
: user['PatientType'];
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
// body['SessionID'] = SESSION_ID; //getSessionId(token);
}
}
}
@ -775,9 +775,6 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: {
// 'Content-Type': 'application/json',
// 'Accept': 'application/json',
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token ?? '',

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
@ -101,6 +102,8 @@ class ProjectViewModel extends BaseViewModel {
this.isLoginChild = isLoginChild;
privilegeRootUser = privilege;
AppGlobal.isNetworkDebugEnabled = havePrivilege(93);
notifyListeners();
}

@ -0,0 +1,72 @@
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw',
appId: '1:815750722565:android:62281cd3e5df4063',
messagingSenderId: '815750722565',
projectId: 'api-project-815750722565',
databaseURL: 'https://api-project-815750722565.firebaseio.com',
storageBucket: 'api-project-815750722565.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA',
appId: '1:815750722565:ios:328ec247a81a2ca23c186c',
messagingSenderId: '815750722565',
projectId: 'api-project-815750722565',
databaseURL: 'https://api-project-815750722565.firebaseio.com',
storageBucket: 'api-project-815750722565.appspot.com',
androidClientId: '815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com',
iosClientId: '815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com',
iosBundleId: 'com.HMG.HMG-Smartphone',
);
}

@ -14,9 +14,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:in_app_update/in_app_update.dart';
import 'package:provider/provider.dart';
@ -27,9 +25,6 @@ import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'pages/pharmacies/compare-list.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
@ -43,21 +38,20 @@ class MyApp extends StatefulWidget {
_MyApp createState() => new _MyApp();
}
class MyHttpOverrides extends HttpOverrides{
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext context){
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
HttpClient createHttpClient(SecurityContext context) {
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}
class _MyApp extends State<MyApp> {
AppUpdateInfo _updateInfo;
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
checkForUpdate() { // todo need to verify 'imp'
checkForUpdate() {
// todo need to verify 'imp'
InAppUpdate.checkForUpdate().then((info) {
print("checkForUpdate!!!");
print(info.toString());
@ -86,7 +80,6 @@ class _MyApp extends State<MyApp> {
@override
Widget build(BuildContext context) {
PlatformBridge.init(context);
PushNotificationHandler(context).init(); // Asyncronously
LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload);

@ -27,6 +27,7 @@ class SendActivationRequest {
String healthId;
int responseID;
int status;
int familyRegionID;
SendActivationRequest(
{this.patientMobileNumber,
@ -56,7 +57,8 @@ class SendActivationRequest {
this.isHijri,
this.healthId,
this.responseID,
this.status});
this.status,
this.familyRegionID});
SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber'];
@ -87,6 +89,7 @@ class SendActivationRequest {
healthId = json['HealthId'];
responseID = json['ReponseID'];
status = json['Status'];
familyRegionID = json['FamilyRegionID'];
}
Map<String, dynamic> toJson() {
@ -119,6 +122,7 @@ class SendActivationRequest {
data['HealthId'] = healthId;
data['ResponseID'] = responseID;
data['Status'] = status;
data['FamilyRegionID'] = familyRegionID;
return data;
}
}

@ -313,6 +313,7 @@ class GetAllSharedRecordsByStatusList {
String patientIdenficationNumber;
String patientName;
String statusDescription;
int familyRegionID;
GetAllSharedRecordsByStatusList(
{this.iD,
@ -335,7 +336,8 @@ class GetAllSharedRecordsByStatusList {
this.patientDataVerified,
this.patientIdenficationNumber,
this.patientName,
this.statusDescription});
this.statusDescription,
this.familyRegionID});
GetAllSharedRecordsByStatusList.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
@ -359,6 +361,7 @@ class GetAllSharedRecordsByStatusList {
patientIdenficationNumber = json['PatientIdenficationNumber'];
patientName = json['PatientName'];
statusDescription = json['StatusDescription'];
familyRegionID = json['FamilyRegionID'];
}
Map<String, dynamic> toJson() {
@ -384,6 +387,7 @@ class GetAllSharedRecordsByStatusList {
data['PatientIdenficationNumber'] = this.patientIdenficationNumber;
data['PatientName'] = this.patientName;
data['StatusDescription'] = this.statusDescription;
data['FamilyRegionID'] = this.familyRegionID;
return data;
}
}

@ -3,7 +3,7 @@ class ApplePayInsertRequest {
int clinicID;
String currency;
String customerEmail;
int customerID;
dynamic customerID;
String customerName;
String deviceToken;
String voipToken;
@ -11,7 +11,7 @@ class ApplePayInsertRequest {
String projectID;
String serviceID;
int channelID;
int patientID;
dynamic patientID;
int patientTypeID;
int patientOutSA;
dynamic appointmentDate;

@ -44,7 +44,7 @@ List<Map<String, dynamic>> countriesData = [
{
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "+966",
"code": "966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
@ -52,7 +52,7 @@ List<Map<String, dynamic>> countriesData = [
{
"name": "United Arab Emirates",
"name_ar": "الإمارات العربية المتحدة",
"code": "+971",
"code": "971",
"countryCode": "AE",
"pattern": "5xxxxxxxx",
"maxLength": 9

@ -0,0 +1,100 @@
class TamaraRequestModel {
String merchantReference;
String merchantIdentifier;
String clientRequestID;
num amount;
String currency;
String language;
String commandType;
String signature;
String customerEmail;
String orderDescription;
bool isInstallment;
int projectID;
String accessCode;
String sHARequestPhase;
String sHAResponsePhase;
String customerName;
String fileNumber;
bool patientOutSA;
String deviceToken;
String longitude;
String latitude;
String appointmentNo;
TamaraRequestModel(
{this.merchantReference,
this.merchantIdentifier,
this.clientRequestID,
this.amount,
this.currency,
this.language,
this.commandType,
this.signature,
this.customerEmail,
this.orderDescription,
this.isInstallment,
this.projectID,
this.accessCode,
this.sHARequestPhase,
this.sHAResponsePhase,
this.customerName,
this.fileNumber,
this.patientOutSA,
this.deviceToken,
this.longitude,
this.latitude,
this.appointmentNo});
TamaraRequestModel.fromJson(Map<String, dynamic> json) {
merchantReference = json['Merchant_Reference'];
merchantIdentifier = json['Merchant_Identifier'];
clientRequestID = json['ClientRequestID'];
amount = json['Amount'];
currency = json['Currency'];
language = json['Language'];
commandType = json['CommandType'];
signature = json['Signature'];
customerEmail = json['CustomerEmail'];
orderDescription = json['OrderDescription'];
isInstallment = json['IsInstallment'];
projectID = json['ProjectID'];
accessCode = json['Access_code'];
sHARequestPhase = json['SHA_RequestPhase'];
sHAResponsePhase = json['SHA_ResponsePhase'];
customerName = json['CustomerName'];
fileNumber = json['FileNumber'];
patientOutSA = json['PatientOutSA'];
deviceToken = json['DeviceToken'];
longitude = json['Longitude'];
latitude = json['Latitude'];
appointmentNo = json['AppointmentNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Merchant_Reference'] = this.merchantReference;
data['Merchant_Identifier'] = this.merchantIdentifier;
data['ClientRequestID'] = this.clientRequestID;
data['Amount'] = this.amount;
data['Currency'] = this.currency;
data['Language'] = this.language;
data['CommandType'] = this.commandType;
data['Signature'] = this.signature;
data['CustomerEmail'] = this.customerEmail;
data['OrderDescription'] = this.orderDescription;
data['IsInstallment'] = this.isInstallment;
data['ProjectID'] = this.projectID;
data['Access_code'] = this.accessCode;
data['SHA_RequestPhase'] = this.sHARequestPhase;
data['SHA_ResponsePhase'] = this.sHAResponsePhase;
data['CustomerName'] = this.customerName;
data['FileNumber'] = this.fileNumber;
data['PatientOutSA'] = this.patientOutSA;
data['DeviceToken'] = this.deviceToken;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
data['AppointmentNo'] = this.appointmentNo;
return data;
}
}

@ -175,7 +175,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced,
// maxLengthEnforced: widget.maxLengthEnforced,
onChanged: widget.onChanged,
focusNode: _focusNode,
maxLength: widget.maxLength ?? null,

@ -250,7 +250,7 @@ class _BookConfirmState extends State<BookConfirm> {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
service.cancelAppointment(appo, context).then((res) {
service.cancelAppointment(appo, context, isReschedule: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () async {

@ -47,6 +47,9 @@ class _BookSuccessState extends State<BookSuccess> {
ProjectViewModel projectViewModel;
String selectedPaymentMethod = "";
String selectedInstallments = "";
String tamaraPaymentStatus;
String tamaraOrderID;
@override
initState() {
@ -537,9 +540,15 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
}))).then((value) {
Navigator.push(
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) {
if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment');
@ -550,6 +559,7 @@ class _BookSuccessState extends State<BookSuccess> {
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0];
selectedInstallments = paymentMethod[1];
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
@ -576,6 +586,12 @@ class _BookSuccessState extends State<BookSuccess> {
onBrowserLoadStart(String url) {
print(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -594,7 +610,71 @@ class _BookSuccessState extends State<BookSuccess> {
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
checkPaymentStatus(appo);
try {
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
}
} else {
checkPaymentStatus(appo);
}
} catch (err) {
print(err);
}
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") {
markAppointmentForTamara(appo);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);
}
}
markAppointmentForTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.markAppointmentForTamara(appo.projectID, appo.appointmentNo.toString()).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment)
insertLiveCareVIDARequest(appo);
else
getAppoQR(context);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
}
autoGenerateInvoiceTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.autoGenerateInvoiceTamara(appo.projectID, appo.appointmentNo.toString(), projectViewModel.user.mobileNumber).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment)
insertLiveCareVIDARequest(appo);
else
getAppoQR(context);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

@ -191,7 +191,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
controller: _tabController,
),
Container(
height: MediaQuery.of(context).size.height,
height: MediaQuery.of(context).size.height * 1.5,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [

@ -38,9 +38,13 @@ class CovidPaymentSummary extends StatefulWidget {
}
class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
ProjectViewModel projectViewModel;
String tamaraPaymentStatus;
String tamaraOrderID;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
@ -102,13 +106,16 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
mFlex(1),
InkWell(
onTap: () {
showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
widget.selectedPaymentMethod = metohd;
widget.selectedInstallmentPlan = selectedInstallmentPlan;
setState(() {});
},
));
showDraggableDialog(
context,
PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
widget.selectedPaymentMethod = metohd;
widget.selectedInstallmentPlan = selectedInstallmentPlan;
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax,
));
},
child: Text(
TranslationBase.of(context).changePayment,
@ -210,7 +217,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
"Covid appointment payment",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
@ -234,6 +241,12 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserLoadStart");
print(url);
if (widget.selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -253,7 +266,74 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
checkPaymentStatus(appo);
try {
if (widget.selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "",
num.parse(widget.selectedInstallmentPlan), appo);
}
} else {
checkPaymentStatus(appo);
}
} catch (err) {
print(err);
}
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") {
markAppointmentForTamara(appo);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);
}
}
markAppointmentForTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.markAppointmentForTamara(appo.projectID, appo.appointmentNo.toString()).then((res) {
GifLoaderDialogUtils.hideDialog(context);
getAppoQR(context);
// autoGenerateInvoiceTamara(appo);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
}
autoGenerateInvoiceTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
var apptData = {
"AppointmentNo": appo.appointmentNo.toString(),
"DoctorID": appo.doctorID.toString(),
"ServiceID": appo.serviceID.toString(),
"ProjectID": appo.projectID.toString(),
"ClinicID": appo.clinicID.toString(),
"AppointmentDate": appo.appointmentDate.toString(),
};
DoctorsListService service = new DoctorsListService();
service.autoGenerateInvoiceTamara(appo.projectID, appo.appointmentNo.toString(), projectViewModel.user.mobileNumber).then((res) {
GifLoaderDialogUtils.hideDialog(context);
getAppoQR(context);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

@ -1,12 +1,12 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart';
import 'custom_radio.dart';
class AskDocDialog extends StatefulWidget {
List<AskDocRequestType> requestData;
static int selectedParameterCode = 0;
@ -22,71 +22,47 @@ class _AskDocDialogState extends State<AskDocDialog> {
Widget build(BuildContext context) {
return Container(
child: Dialog(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.77,
width: 450.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).requestType,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
child: CustomRadio(requestData: widget.requestData),
),
Container(
width: MediaQuery.of(context).size.width,
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
side: BorderSide(color: Colors.blue)),
color: Colors.blue,
elevation: 0,
onPressed: () {
if(AskDocDialog.selectedParameterCode != 0)
Navigator.pop(context, AskDocDialog.selectedParameterCode);
else
AppToast.showErrorToast(message: "Please select request type to continue");
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
child: OutlineButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)),
color: Colors.red,
borderSide: BorderSide(color: Colors.red),
highlightColor: Colors.red,
highlightedBorderColor: Colors.red,
onPressed: () {
Navigator.pop(context, null);
},
child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
]),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).requestType, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, fontFamily: "Open-Sans-Bold")),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
child: CustomRadio(requestData: widget.requestData),
),
Container(
width: MediaQuery.of(context).size.width,
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.blue)),
color: Colors.blue,
elevation: 0,
onPressed: () {
if (AskDocDialog.selectedParameterCode != 0)
Navigator.pop(context, AskDocDialog.selectedParameterCode);
else
AppToast.showErrorToast(message: "Please select request type to continue");
},
child: Text(TranslationBase.of(context).confirm, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontFamily: 'Open-Sans-Bold')),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
child: DefaultButton(
TranslationBase.of(context).cancel_nocaps,
() {
Navigator.pop(context, null);
},
),
),
]),
),
),
);

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/custom_radio.d
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart';
import 'package:manage_calendar_events/manage_calendar_events.dart';
@ -15,13 +16,7 @@ class ReminderDialog extends StatefulWidget {
final String endDate;
final String location;
ReminderDialog(
{@required this.eventId,
@required this.title,
@required this.description,
@required this.startDate,
@required this.endDate,
@required this.location});
ReminderDialog({@required this.eventId, @required this.title, @required this.description, @required this.startDate, @required this.endDate, @required this.location});
@override
_ReminderDialogState createState() => _ReminderDialogState();
@ -38,12 +33,10 @@ class _ReminderDialogState extends State<ReminderDialog> {
child: Container(
// height: MediaQuery.of(context).size.height * 0.57,
width: 450.0,
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).setReminder,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).setReminder, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
@ -54,32 +47,24 @@ class _ReminderDialogState extends State<ReminderDialog> {
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.blue)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.blue)),
color: Colors.blue,
elevation: 0,
onPressed: () {
print(ReminderDialog.selectedDuration);
createCalendarEvent();
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).confirm, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0, bottom: 20.0),
child: OutlineButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
color: Colors.red,
borderSide: BorderSide(color: Colors.red),
highlightColor: Colors.red,
highlightedBorderColor: Colors.red,
onPressed: () {
child: DefaultButton(
TranslationBase.of(context).cancel_nocaps,
() {
Navigator.of(context).pop();
},
child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
),
),
]),
@ -101,8 +86,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
eventId: widget.eventId,
title: widget.title,
description: widget.description,
startDate: DateUtil.convertStringToDate(widget.startDate)
.subtract(new Duration(microseconds: ReminderDialog.selectedDuration)),
startDate: DateUtil.convertStringToDate(widget.startDate).subtract(new Duration(microseconds: ReminderDialog.selectedDuration)),
endDate: DateUtil.convertStringToDate(widget.endDate),
location: widget.location,
duration: new Duration(minutes: 15).inMinutes,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/custom_radio.d
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart';
import 'package:manage_calendar_events/manage_calendar_events.dart';
@ -33,7 +34,6 @@ class PrescriptionReminderDialog extends StatefulWidget {
}
class _ReminderDialogState extends State<PrescriptionReminderDialog> {
@override
Widget build(BuildContext context) {
return Container(
@ -42,12 +42,10 @@ class _ReminderDialogState extends State<PrescriptionReminderDialog> {
child: Container(
// height: MediaQuery.of(context).size.height * 0.57,
width: 450.0,
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).setReminder,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).setReminder, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
@ -58,31 +56,35 @@ class _ReminderDialogState extends State<PrescriptionReminderDialog> {
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.blue)),
color: Colors.blue,elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.blue)),
color: Colors.blue,
elevation: 0,
onPressed: () {
createOrUpdateEvents();
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).confirm, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0, bottom: 20.0),
child: OutlineButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
color: Colors.red,
borderSide: BorderSide(color: Colors.red),
highlightColor: Colors.red,
highlightedBorderColor: Colors.red,
onPressed: () {
child: DefaultButton(
TranslationBase.of(context).cancel_nocaps,
() {
Navigator.of(context).pop();
},
child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
),
// OutlineButton(
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
// color: Colors.red,
// borderSide: BorderSide(color: Colors.red),
// highlightColor: Colors.red,
// highlightedBorderColor: Colors.red,
// onPressed: () {
// Navigator.of(context).pop();
// },
// child: Text(TranslationBase.of(context).cancel_nocaps, style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
// ),
),
]),
),
@ -97,17 +99,11 @@ class _ReminderDialogState extends State<PrescriptionReminderDialog> {
widget._scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day));
}
List<DateTime> scheduleDateTime = calculateDaysInterval(
widget.startDate.subtract(new Duration(microseconds: PrescriptionReminderDialog.selectedDuration)),
widget.endDate);
List<DateTime> scheduleDateTime = calculateDaysInterval(widget.startDate.subtract(new Duration(microseconds: PrescriptionReminderDialog.selectedDuration)), widget.endDate);
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils.createOrUpdateEvents(
scheduleList: widget._scheduleList,
description: widget.description,
title: widget.title,
scheduleDateTime: scheduleDateTime);
calendarUtils.createOrUpdateEvents(scheduleList: widget._scheduleList, description: widget.description, title: widget.title, scheduleDateTime: scheduleDateTime);
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
}

@ -61,6 +61,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel;
TabController _tabController;
String selectedPaymentMethod = "";
String selectedInstallments = "";
String tamaraPaymentStatus;
String tamaraOrderID;
@override
void initState() {
widget.patientShareResponse = new PatientShareResponse();
@ -889,6 +894,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
print(url);
// Uri myUri = Uri.parse(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
print(tamaraPaymentStatus);
print(tamaraOrderID);
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -908,9 +921,85 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
checkPaymentStatus(appo);
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
}
} else {
checkPaymentStatus(appo);
}
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") {
markAppointmentForTamara(appo);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);
}
}
markAppointmentForTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
var apptData = {
"AppointmentNo": appo.appointmentNo.toString(),
"DoctorID": appo.doctorID.toString(),
"ServiceID": appo.serviceID.toString(),
"ProjectID": appo.projectID.toString(),
"ClinicID": appo.clinicID.toString(),
"AppointmentDate": appo.appointmentDate.toString(),
};
DoctorsListService service = new DoctorsListService();
service.markAppointmentForTamara(appo.projectID, appo.appointmentNo.toString()).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment)
addVIDARequestInsert("0", tamaraOrderID, apptData);
else
getAppoQR(context, appo);
// autoGenerateInvoiceTamara(appo);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
}
// autoGenerateInvoiceTamara(AppoitmentAllHistoryResultList appo) {
// GifLoaderDialogUtils.showMyDialog(context);
// var apptData = {
// "AppointmentNo": appo.appointmentNo.toString(),
// "DoctorID": appo.doctorID.toString(),
// "ServiceID": appo.serviceID.toString(),
// "ProjectID": appo.projectID.toString(),
// "ClinicID": appo.clinicID.toString(),
// "AppointmentDate": appo.appointmentDate.toString(),
// };
// DoctorsListService service = new DoctorsListService();
// service.autoGenerateInvoiceTamara(appo.projectID, appo.appointmentNo.toString(), projectViewModel.user.mobileNumber).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// if (appo.isLiveCareAppointment)
// addVIDARequestInsert("0", tamaraOrderID, apptData);
// else
// getAppoQR(context, appo);
// }).catchError((err) {
// print(err);
// AppToast.showErrorToast(message: err);
// GifLoaderDialogUtils.hideDialog(context);
// });
// }
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String txn_ref;
num amount;
@ -986,10 +1075,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
}))).then((value) {
Navigator.push(
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) {
print(value);
selectedPaymentMethod = value[0];
selectedInstallments = value[1];
getPatientAppointmentHistory();
if (value != null) {

@ -15,8 +15,10 @@ import 'package:provider/provider.dart';
class PaymentMethod extends StatefulWidget {
Function onSelectedMethod;
bool isShowInstallments;
num patientShare;
bool isFromAdvancePayment;
PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false});
PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false, this.patientShare, this.isFromAdvancePayment = false});
@override
_PaymentMethodState createState() => _PaymentMethodState();
@ -27,9 +29,23 @@ class _PaymentMethodState extends State<PaymentMethod> {
TamaraInstallmentDetails tamaraInstallmentDetails;
String selectedInstallmentPlan;
num minTamaraLimit = 0;
num maxTamaraLimit = 0;
ProjectViewModel projectViewModel;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) {
getTamaraPaymentDetails();
});
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true,
@ -198,7 +214,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
),
),
if (projectViewModel.havePrivilege(90))
if (projectViewModel.havePrivilege(90) && !widget.isFromAdvancePayment && widget.patientShare >= minTamaraLimit && widget.patientShare <= maxTamaraLimit)
Container(
width: double.infinity,
child: InkWell(
@ -227,7 +243,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0,
padding: EdgeInsets.all(0.0),
width: 60,
child: Image.asset("assets/images/new/payment/tamara.png"),
child: SvgPicture.asset("assets/images/new/payment/tamara.svg"),
),
mFlex(1),
if (selectedPaymentMethod == "TAMARA")
@ -503,9 +519,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
setState(() {
selectedPaymentMethod = selectedMethod;
});
if (selectedMethod == "TAMARA") {
getTamaraPaymentDetails();
}
// if (selectedMethod == "TAMARA") {
// getTamaraPaymentDetails();
// }
}
getTamaraPaymentDetails() {
@ -514,6 +530,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
service.getTamaraPaymentDetails(context).then((res) {
tamaraInstallmentDetails = TamaraInstallmentDetails.fromJson(res);
print(tamaraInstallmentDetails.name);
minTamaraLimit = tamaraInstallmentDetails.supportedInstalments[0].minLimit.amount;
maxTamaraLimit = tamaraInstallmentDetails.supportedInstalments[0].maxLimit.amount;
selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[0].instalments.toString();
GifLoaderDialogUtils.hideDialog(context);
setState(() {});

@ -16,8 +16,8 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family;
@ -34,7 +34,6 @@ import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/selection-dailog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
@ -287,73 +286,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
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;
@ -363,7 +295,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.setAutoInitEnabled(true);
// locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus();
@ -377,6 +308,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token);
sharedPref.setString(PUSH_TOKEN, token);
if(Platform.isIOS) {
voIPKit.getVoIPToken().then((value) {
print('🎈 example: getVoIPToken: $value');
AppSharedPreferences().setString(APNS_TOKEN, value);
getOneSignalVOIPToken(value);
});
}
if (token != null) {
DEVICE_TOKEN = token;
if (!projectViewModel.isLoginChild) {
@ -422,8 +360,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
login() async {
dummyCall();
return;
// dummyCall();
// return;
// FirebaseCrashlytics.instance.crash();
// return;
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
@ -451,44 +391,59 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
dummyCall() async {
// final server = await SelectionDialog(
// context,
// title: "Select Server",
// items: ["https://livecareturn.hmg.com:8086", "https://104.197.179.1:8086"]
// ).show();
//
// final json = {
// "callerID": "s1",
// "PatientID": "s2",
// "msgID": "123",
// "notfID": "123",
// "notification_foreground": "true",
// "count": "1",
// "message": "Doctor is calling ",
// "AppointmentNo": "123",
// "title": "Rayyan Hospital",
// "ProjectID": "123",
// "NotificationType": "10",
// "background": "1",
// "doctorname": "Dr Sulaiman Al Habib",
// "clinicname": "ENT Clinic",
// "speciality": "Speciality",
// "appointmentdate": "Sun, 15th Dec, 2019",
// "appointmenttime": "09:00",
// "type": "video",
// "session_id":
// "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0LTE1OTg3NzQ1MDYiLCJpc3MiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0Iiwic3ViIjoiQUNhYWQ1YTNmOGM2NGZhNjczNTY3NTYxNTc0N2YyNmMyYiIsImV4cCI6MTU5ODc3ODEwNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiSGFyb29uMSIsInZpZGVvIjp7InJvb20iOiJTbWFsbERhaWx5U3RhbmR1cCJ9fX0.7XUS5uMQQJfkrBZu9EjQ6STL6R7iXkso6BtO1HmrQKk",
// "identity": "Haroon1",
// "name": "SmallDailyStandup",
// "videoUrl": "video",
// "picture": "video",
// "is_call": "true",
// "server": server,
// };
// IncomingCallData incomingCallData = IncomingCallData.fromJson(json);
// final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: incomingCallData)));
String callerId =
"2_MX40NjIwOTk2Mn5-MTY1NjU3NTQ4MzQ0NX5aSGczeVlObGNVMGJXWEFWRnc0akZRcm1-fg*T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9MzY5MTBmZmUyMDRiNjE3NTRiYzlmNjVjMTEyZTE1MWFjN2YxYjAxZTpzZXNzaW9uX2lkPTJfTVg0ME5qSXdPVGsyTW41LU1UWTFOalUzTlRRNE16UTBOWDVhU0djemVWbE9iR05WTUdKWFdFRldSbmMwYWtaUmNtMS1mZyZjcmVhdGVfdGltZT0xNjU2NTc1NDgzJm5vbmNlPTAuNzM3OTQyOTY4Mzg5OTU1MiZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjU2NjYxODgzJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9*true*s1*s2*https://livecareturn.hmg.com:8086";
String sessionID = callerId.split("*")[0];
String token = callerId.split("*")[1];
String isWebRTC = callerId.split("*")[2];
print("🎈 SessionID: $sessionID");
print("🎈 Token: $token");
print("🎈 isWebRTC: $isWebRTC");
final server = await SelectionDialog(
context,
title: "Select Server",
items: ["https://livecareturn.hmg.com:8086", "https://104.197.179.1:8086"]
).show();
final json = {
"callerID": "s1",
"PatientID": "s2",
"msgID": "123",
"notfID": "123",
"notification_foreground": "true",
"count": "1",
"message": "Doctor is calling ",
"AppointmentNo": "123",
"title": "Rayyan Hospital",
"ProjectID": "123",
"NotificationType": "10",
"background": "1",
"doctorname": "Dr Sulaiman Al Habib",
"clinicname": "ENT Clinic",
"speciality": "Speciality",
"appointmentdate": "Sun, 15th Dec, 2019",
"appointmenttime": "09:00",
"type": "video",
"session_id":
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0LTE1OTg3NzQ1MDYiLCJpc3MiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0Iiwic3ViIjoiQUNhYWQ1YTNmOGM2NGZhNjczNTY3NTYxNTc0N2YyNmMyYiIsImV4cCI6MTU5ODc3ODEwNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiSGFyb29uMSIsInZpZGVvIjp7InJvb20iOiJTbWFsbERhaWx5U3RhbmR1cCJ9fX0.7XUS5uMQQJfkrBZu9EjQ6STL6R7iXkso6BtO1HmrQKk",
"identity": "Haroon1",
"name": "SmallDailyStandup",
"videoUrl": "video",
"picture": "video",
"is_call": "true",
"server": server,
};
IncomingCallData incomingCallData = IncomingCallData.fromJson(json);
final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: incomingCallData)));
String caller = callerId.split("*")[3];
String receiver = callerId.split("*")[4];
String host = callerId.split("*")[5];
await Navigator.push(context, MaterialPageRoute(builder: (context) => StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host)));
}
getNotificationCount(token) async {

@ -235,18 +235,18 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
MaterialPageRoute(
// fullscreenDialog: true,
builder: (BuildContext context) {
final caller = widget.incomingCallData.callerID;
final receiver = widget.incomingCallData.receiverID;
final host = widget.incomingCallData.server;
if(widget.incomingCallData.isWebRTC == "true"){
return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
}else{
// final caller = widget.incomingCallData.callerID;
// final receiver = widget.incomingCallData.receiverID;
// final host = widget.incomingCallData.server;
// if(widget.incomingCallData.isWebRTC == "true"){
// return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
// }else{
return OpenTokConnectCallPage(
apiKey: OPENTOK_API_KEY,
sessionId: widget.incomingCallData.sessionId,
token: widget.incomingCallData.token
);
}
// }
// return VideoCallWebPage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // Web WebRTC VideoCall

@ -76,6 +76,10 @@ class _clinic_listState extends State<ClinicList> {
String selectedPaymentMethod = "";
String amount = "";
String tamaraPaymentStatus;
String tamaraOrderID;
String selectedInstallmentPlan;
@override
void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -287,12 +291,18 @@ class _clinic_listState extends State<ClinicList> {
});
}
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
}))).then((value) {
Navigator.push(
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
patientShare: num.parse(getERAppointmentFeesList.total),
))).then((value) {
print(value);
if (value != null) {
openPayment(value, authUser, double.parse(getERAppointmentFeesList.total), appo);
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo);
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment');
}
});
@ -302,6 +312,7 @@ class _clinic_listState extends State<ClinicList> {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0];
selectedInstallmentPlan = paymentMethod[1];
this.amount = amount.toString();
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0],
@ -312,6 +323,12 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserLoadStart");
print(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
@ -331,7 +348,49 @@ class _clinic_listState extends State<ClinicList> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
checkPaymentStatus(appo);
try {
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
}
} else {
checkPaymentStatus(appo);
}
} catch (err) {
print(err);
}
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") {
addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo));
} else {
AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
appointment_type: 'livecare',
payment_type: 'appointment',
payment_method: selectedPaymentMethod,
txn_amount: this.amount,
txn_currency: currency,
error_message: res['Response_Message']);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);
}
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

@ -386,8 +386,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null) {
// final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
// final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
request.healthId = healthId;
request.isHijri = isHijri;
@ -398,6 +396,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: r);
});
} else {
request.dob = "";
@ -410,6 +409,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: r.toString());
});
}
}

@ -192,7 +192,7 @@ class _ForgotPassword extends State<ForgotPassword> {
final authService = new AuthProvider();
var request = {
"LogInTokenID": token,
"PatientOutSA": countryCode == '966' ? 0 : 1,
"PatientOutSA": (countryCode == '966' || countryCode == '+966') ? 0 : 1,
"PatientMobileNumber": mobileNo,
"ZipCode": countryCode,
"activationCode": value,

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -30,7 +31,6 @@ import 'package:flutter/rendering.dart';
import 'package:provider/provider.dart';
class Login extends StatefulWidget {
@override
_Login createState() => _Login();
}
@ -255,22 +255,30 @@ class _Login extends State<Login> {
}
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
GifLoaderDialogUtils.showMyDialog(context);
authService
.checkPatientAuthentication(request)
.then((value) => {
if (value['isSMSSent'])
{
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
GifLoaderDialogUtils.hideDialog(context),
Navigator.of(context).push(FadePage(page: ConfirmLogin())),
}
else
{
if (value['IsAuthenticated']) {this.checkActivationCode()}
}
})
.catchError((err) {
authService.checkPatientAuthentication(request).then((value) {
if (value['UserAccountIsActivated']) {
if (value['isSMSSent']) {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request);
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).push(FadePage(page: ConfirmLogin()));
} else {
if (value['IsAuthenticated']) {
this.checkActivationCode();
}
}
} else {
ConfirmDialog activationDialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).accountDeactivatedMsg,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()},
cancelFunction: () => {});
GifLoaderDialogUtils.hideDialog(context);
activationDialog.showAlertDialog(context);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
@ -287,6 +295,25 @@ class _Login extends State<Login> {
});
}
activatePatientFile() {
GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> request = {};
request["IsActive"] = true;
if (this.loginType == 1) {
request['PatientIdentificationID'] = int.parse(nationalIDorFile.text);
} else {
request['PatientID'] = int.parse(nationalIDorFile.text);
}
request["PatientMobileNumber"] = mobileNo;
authService.deactivateAccount(request, true).then((result) {
GifLoaderDialogUtils.hideDialog(context);
checkUserAuthentication();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
}
checkActivationCode({code}) async {
Map<String, dynamic> request = {};
if (code == null) request['PatientMobileNumber'] = int.parse(mobileNo);

@ -397,7 +397,7 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1,
"FirstNameN": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn,
"MiddleNameN": registerInfo.secondNameAr,

@ -327,7 +327,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
isShowInstallments: num.tryParse(amount) >= 1000 ? true : false),
isShowInstallments: false, isFromAdvancePayment: true),
),
).then(
(value) {

@ -176,7 +176,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced,
// maxLengthEnforced: widget.maxLengthEnforced,
onChanged: widget.onChanged,
focusNode: _focusNode,
maxLength: widget.maxLength ?? null,

@ -62,7 +62,7 @@ class PrescriptionItemsPage extends StatelessWidget {
prescriptions.doctorRate,
prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate,
model.user.emailAddress,
projectViewModel.user.emailAddress,
),
isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false,
showConfirmMessageDialog: false,

@ -53,7 +53,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology.doctorRate,
finalRadiology.actualDoctorRate,
finalRadiology.noOfPatientsRate,
model.user.emailAddress,
projectViewModel.user.emailAddress,
),
onTap: () {
showConfirmMessage(finalRadiology: finalRadiology, model: model, userObj: projectViewModel.user);

@ -1,11 +1,13 @@
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -45,7 +47,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(21.0),
padding: const EdgeInsets.only(left: 21, right: 21, top: 21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -215,15 +217,15 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
mHeight(8),
inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact),
mHeight(10),
InkWell(
onTap: () {
deactivateAccount();
},
child: Text(
TranslationBase.of(context).deleteAccount,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline),
),
),
// InkWell(
// onTap: () {
// deactivateAccount();
// },
// child: Text(
// TranslationBase.of(context).deleteAccount,
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline),
// ),
// ),
mHeight(8),
],
),
@ -231,19 +233,30 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
),
),
Container(
width: double.infinity,
child: Card(
margin: EdgeInsets.zero,
elevation: 0,
child: Padding(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 16),
child: DefaultButton(
TranslationBase.of(context).save,
() {
saveSettings();
},
padding: EdgeInsets.all(12),
color: Colors.white,
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).deleteAccount,
() {
deactivateAccount();
},
),
),
),
mWidth(12),
Expanded(
child: DefaultButton(
TranslationBase.of(context).save,
() {
saveSettings();
},
color: CustomColors.green,
),
),
],
),
),
],
@ -355,10 +368,11 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> request = {};
request["IsActive"] = false;
authService.deactivateAccount(request).then((result) {
request["PatientIdentificationID"] = projectProvider.user.patientIdentificationNo;
request["PatientMobileNumber"] = Utils.getPhoneNumberWithoutZero(projectProvider.user.mobileNumber);
authService.deactivateAccount(request, false).then((result) {
AppToast.showSuccessToast(message: TranslationBase.of(context).accountDeactivated);
GifLoaderDialogUtils.hideDialog(context);
});
}
@ -386,6 +400,12 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
request["IsEmailAlertRequired"] = this.emailAlert;
request["IsSMSAlertRequired"] = this.smsAlert;
request["PreferredLanguage"] = this.language.toString();
authService.saveSettings(request).then((result) => {AppToast.showSuccessToast(message: TranslationBase.of(context).profileUpdate), GifLoaderDialogUtils.hideDialog(context)});
authService.saveSettings(request).then((result) {
AppToast.showSuccessToast(message: TranslationBase.of(context).profileUpdate);
GifLoaderDialogUtils.hideDialog(context);
AuthenticatedUser authUser = projectProvider.user;
authUser.emailAddress = this.emailController.text;
projectProvider.setUser(authUser);
});
}
}

@ -403,7 +403,7 @@ class Signaling {
'to': session.remote_user?.id,
'from': session.local_user.id,
'candidate': {
'sdpMLineIndex': candidate.sdpMlineIndex, // sdpMlineIndex or sdpMLineIndex
'sdpMLineIndex': candidate.sdpMLineIndex, // sdpMlineIndex or sdpMLineIndex
'sdpMid': candidate.sdpMid,
'candidate': candidate.candidate,
},

@ -761,7 +761,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> cancelAppointment(AppoitmentAllHistoryResultList appo, BuildContext context) async {
Future<Map> cancelAppointment(AppoitmentAllHistoryResultList appo, BuildContext context, {bool isReschedule = false}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -776,6 +776,7 @@ class DoctorsListService extends BaseService {
"AppointmentID": appo.appointmentNo,
"ClinicID": appo.clinicID,
"ProjectID": appo.projectID,
"CancelToReschadual": isReschedule,
"EndTime": appo.endTime,
"StartTime": appo.startTime,
"DoctorID": appo.doctorID,
@ -1681,4 +1682,49 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments) async {
Map<String, dynamic> request = {
"Response_Message": responseMessage,
"ClientRequestID": clientRequestID,
"Status": status,
"FortID": tamaraOrderID, // Tamara order ID
"Installments_Number": selectedInstallments
};
dynamic localRes;
await baseAppClient.post(UPDATE_TAMARA_STATUS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> markAppointmentForTamara(int projectID, String appoNo) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AppointmentNo": appoNo};
dynamic localRes;
await baseAppClient.post(MARK_APPOINTMENT_TAMARA_STATUS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> autoGenerateInvoiceTamara(int projectID, String appoNo, String mobileNo) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102};
dynamic localRes;
await baseAppClient.post(AUTO_GENERATE_INVOICE_TAMARA, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -59,6 +61,7 @@ class AuthProvider with ChangeNotifier {
bool isLoading = true;
dynamic authenticatedUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
var languageID;
AuthProvider() {
getUserAuthentication();
@ -66,6 +69,7 @@ class AuthProvider with ChangeNotifier {
void getUserAuthentication() async {
Map profile = await sharedPref.getObject(USER_PROFILE);
languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (profile != null) {
isLoading = false;
isLogin = true;
@ -167,8 +171,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID;
request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.languageID = (languageID == 'ar' ? 1 : 2);
request.patientOutSA = (request.zipCode == '966' || request.zipCode == '+966') ? 0 : 1;
try {
dynamic localRes;
await new BaseAppClient().post(CHECK_PATIENT_AUTH, onSuccess: (dynamic response, int statusCode) {
@ -188,8 +192,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID;
request.deviceTypeID = DeviceTypeID;
request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false;
// request.patientTypeID = request.patientType;
@ -208,8 +212,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID;
request.deviceTypeID = DeviceTypeID;
request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false;
@ -228,8 +232,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID;
request.deviceTypeID = DeviceTypeID;
request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false;
@ -252,8 +256,7 @@ class AuthProvider with ChangeNotifier {
neRequest.channel = CHANNEL;
neRequest.iPAdress = IP_ADDRESS;
neRequest.generalid = GENERAL_ID;
// neRequest.languageID = LANGUAGE_ID;
neRequest.deviceTypeID = DeviceTypeID;
neRequest.deviceTypeID = Platform.isIOS ? 1 : 2;
neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1;
neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true;
neRequest.isDentalAllowedBackend = false;
@ -284,8 +287,8 @@ class AuthProvider with ChangeNotifier {
neRequest.channel = CHANNEL;
neRequest.iPAdress = IP_ADDRESS;
neRequest.generalid = GENERAL_ID;
// neRequest.languageID = LANGUAGE_ID;
neRequest.deviceTypeID = DeviceTypeID;
// request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = Platform.isIOS ? 1 : 2;
neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1;
neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true;
neRequest.isDentalAllowedBackend = false;
@ -319,8 +322,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID;
request.deviceTypeID = DeviceTypeID;
request.languageID = LANGUAGE_ID;
request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.isRegister = false;
// request.tokenID = '';
dynamic localRes;
@ -342,8 +345,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID;
request.deviceTypeID = DeviceTypeID;
request.languageID = LANGUAGE_ID;
request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = Platform.isIOS ? 1 : 2;
// request.tokenID = '';
dynamic localRes;
@ -365,8 +368,8 @@ class AuthProvider with ChangeNotifier {
request['Channel'] = CHANNEL;
request['IPAdress'] = IP_ADDRESS;
request['Generalid'] = GENERAL_ID;
request['DeviceTypeID'] = DeviceTypeID;
request['LanguageID'] = LANGUAGE_ID;
request['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
request['LanguageID'] = (languageID == 'ar' ? 1 : 2);
request['LogInTokenID'] = await sharedPref.getString(LOGIN_TOKEN_ID);
var nhic = await sharedPref.getObject(NHIC_DATA);
var requestN = RegisterUserRequest.fromJson(request);
@ -397,7 +400,7 @@ class AuthProvider with ChangeNotifier {
var request = new RegisteredAuthenticatedUserRequest();
request.deviceToken = deviceToken;
request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false);
request.deviceType = DeviceTypeID.toString();
request.deviceType = Platform.isIOS ? "1" : "2";
request.patientMobileNumber = user.mobileNumber[0] == '0' ? user.mobileNumber : '0' + user.mobileNumber;
request.nationalID = user.patientIdentificationNo;
request.gender = user.gender;
@ -447,15 +450,12 @@ class AuthProvider with ChangeNotifier {
}
Future<dynamic> forgotPasswordActivation(request, [value]) async {
// var neRequest = CheckActivationCodeReq.fromJson(request);
// neRequest.activationCode = value ?? "0000";
// neRequest.isSilentLogin = value != null ? false : true;
request['VersionID'] = VERSION_ID;
request['Channel'] = CHANNEL;
request['IPAdress'] = IP_ADDRESS;
request['generalid'] = GENERAL_ID;
request['LanguageID'] = LANGUAGE_ID;
request['DeviceTypeID'] = DeviceTypeID;
request['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
request['LanguageID'] = (languageID == 'ar' ? 1 : 2);
dynamic localRes;
try {
@ -522,7 +522,23 @@ class AuthProvider with ChangeNotifier {
}
}
Future deactivateAccount(request) async {
Future deactivateAccount(request, bool isLogin) async {
dynamic localRes;
try {
await new BaseAppClient().post(DEACTIVATE_ACCOUNT, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
localRes = error;
return Future.value(error);
}, body: request);
if (!isLogin) logout();
return Future.value(localRes);
} catch (error) {
throw error;
}
}
Future activateAccount(request) async {
dynamic localRes;
try {
await new BaseAppClient().post(DEACTIVATE_ACCOUNT, onSuccess: (dynamic response, int statusCode) {
@ -547,5 +563,4 @@ class AuthProvider with ChangeNotifier {
model.setState(0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}
}

@ -151,6 +151,7 @@ class FamilyFilesProvider with ChangeNotifier {
request.isRegister = false;
request.responseID = responseID;
request.status = 2;
request.familyRegionID = zipCode == '966' ? 1 : 2;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
@ -237,7 +238,7 @@ class FamilyFilesProvider with ChangeNotifier {
if (mainUser == true) {
var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER));
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
request['PatientOutSA'] = currentUser.outSA; //currentUser.outSA; //? 1 : 0;
request['LoginType'] = await sharedPref.getInt(LAST_LOGIN) ?? 1;
request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString();
request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber'];
@ -255,7 +256,8 @@ class FamilyFilesProvider with ChangeNotifier {
//const request = new SwitchUserRequest();
// request['LogInTokenID'] = '';
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
// request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
request['PatientOutSA'] = switchUser.familyRegionID != null ? switchUser.familyRegionID == 1 ? 0 : 1 : currentUser.outSA; //currentUser.outSA; //? 1 : 0;
request['PatientMobileNumber'] = switchUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2;
request['SuperUser'] = switchUser.patientID; //currentUser.PatientID;

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/tamara_request_model.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
@ -265,9 +266,7 @@ class LiveCareService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
dynamic localRes;
await baseAppClient.post(APPLE_PAY_INSERT_REQUEST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
@ -314,10 +313,20 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> tamaraInsertRequest(TamaraRequestModel tamaraInsertRequest, BuildContext context) async {
dynamic localRes;
await baseAppClient.post(TAMARA_REQUEST_INSERT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: tamaraInsertRequest.toJson(), isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getOneSignalVOIPToken(String voipToken, BuildContext context) async {
Map<String, dynamic> request;
// request = {"app_id": "eb8e49e5-dec7-4ed2-8d6a-4df8cb301406", "identifier": voipToken, "device_type": 0, "test_type": 1};
// request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0, "test_type": 1};
request = { "app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0 };
dynamic localRes;

@ -1,10 +1,11 @@
import 'dart:async';
import 'dart:convert';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -42,8 +43,7 @@ class _SplashScreenState extends State<SplashScreen> {
},
);
AppSharedPreferences().getAll().then((value){
AppSharedPreferences().getAll().then((value) {
// debugPrint("ALL SHARED PREFERENCES!!!!!");
// debugPrint(jsonEncode(value));
});
@ -54,8 +54,11 @@ class _SplashScreenState extends State<SplashScreen> {
await _privilegeService.getPrivilege();
ProjectViewModel projectProvider = Provider.of<ProjectViewModel>(context, listen: false);
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch
AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en");
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
PushNotificationHandler(context).init(); // Asyncronously
}
@override

@ -4,7 +4,7 @@ import '../widgets/Loader/gif_loader_container.dart';
class GifLoaderDialogUtils {
static showMyDialog(BuildContext context) {
showDialog(context: context, barrierDismissible: false, builder: (cxt) => GifLoaderContainer());
showDialog(context: context, barrierDismissible: true, builder: (cxt) => GifLoaderContainer());
}
static hideDialog(BuildContext context) {

@ -1,6 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:ffi';
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
@ -10,9 +9,7 @@ import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/pages/webRTC/OpenTok/OpenTok.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app-permissions.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
@ -88,15 +85,16 @@ RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message) {
return fire_message;
}
callPage(String sessionID, String token, String isWebrtc, String callerIdString) async {
if (isWebrtc == "true"){
String caller = callerIdString.split("*")[3];
String receiver = callerIdString.split("*")[4];
String host = callerIdString.split("*")[5];
return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
}else{
await NavigationService.navigateToPage(OpenTokConnectCallPage(apiKey: OPENTOK_API_KEY, sessionId: sessionID, token: token));
}
// callPage(String sessionID, String token, String isWebrtc, String callerIdString) async {
callPage(String sessionID, String token) async {
// if (isWebrtc == "true"){
// String caller = callerIdString.split("*")[3];
// String receiver = callerIdString.split("*")[4];
// String host = callerIdString.split("*")[5];
// return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
// }else{
await NavigationService.navigateToPage(OpenTokConnectCallPage(apiKey: OPENTOK_API_KEY, sessionId: sessionID, token: token));
// }
}
_incomingCall(Map data) async {
@ -201,7 +199,7 @@ class PushNotificationHandler {
String sessionID = callerId.split("*")[0];
String token = callerId.split("*")[1];
String isWebRTC = callerId.split("*")[2];
// String isWebRTC = callerId.split("*")[2];
print("🎈 SessionID: $sessionID");
print("🎈 Token: $token");
@ -214,15 +212,9 @@ class PushNotificationHandler {
Future.delayed(new Duration(milliseconds: 2000)).then((value) async {
print("🎈 Incoming Call!!!");
callPage(sessionID, token, isWebRTC, callerId);
// callPage(sessionID, token, isWebRTC, callerId);
callPage(sessionID, token);
});
// print("🎈 Identity: $identity");
// print("🎈 Name: $name");
// setState(() {
// isTalking = true;
// });
};
if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) {

@ -2859,6 +2859,7 @@ class TranslationBase {
String get deleteAccount => localizedValues["deleteAccount"][locale.languageCode];
String get deactivateAccount => localizedValues["deactivateAccount"][locale.languageCode];
String get accountDeactivated => localizedValues["accountDeactivated"][locale.languageCode];
String get accountDeactivatedMsg => localizedValues["accountDeactivatedMsg"][locale.languageCode];
}

@ -55,7 +55,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
widget.patientLabOrder.doctorRate,
widget.patientLabOrder.actualDoctorRate,
widget.patientLabOrder.noOfPatientsRate,
model.user.emailAddress),
projectViewModel.user.emailAddress),
onTap: widget.onTap,
),
SizedBox(height: 10),

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
@ -607,6 +609,7 @@ class _AppDrawerState extends State<AppDrawer> {
loginAfter(result, context, isMainUser) async {
Utils.hideProgressDialog();
String APNSToken = "";
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: !isMainUser);
result = CheckActivationCode.fromJson(result);
var bloodType = await sharedPref.getString(BLOOD_TYPE);

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/tamara_request_model.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -162,7 +163,7 @@ class MyInAppBrowser extends InAppBrowser {
applePayInsertRequest.clinicID = (clinicID != null && clinicID != "") ? clinicID : 0;
applePayInsertRequest.currency = authenticatedUser.outSA == 1 ? "AED" : "SAR";
applePayInsertRequest.customerEmail = emailId;
applePayInsertRequest.customerID = num.parse(patientID);
applePayInsertRequest.customerID = patientID;
applePayInsertRequest.customerName = patientName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
@ -170,7 +171,7 @@ class MyInAppBrowser extends InAppBrowser {
applePayInsertRequest.projectID = projId;
applePayInsertRequest.serviceID = servID;
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = num.parse(patientID);
applePayInsertRequest.patientID = patientID;
applePayInsertRequest.patientTypeID = authenticatedUser.patientType;
applePayInsertRequest.patientOutSA = authenticatedUser.outSA;
applePayInsertRequest.appointmentDate = (appoDate != null && appoDate != "") ? appoDate : null;
@ -198,11 +199,43 @@ class MyInAppBrowser extends InAppBrowser {
AppToast.showErrorToast(message: err);
});
} else if (paymentMethod == "TAMARA") {
generateTamaraURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,
clinicID, doctorID, "", installments)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);
LiveCareService service = new LiveCareService();
TamaraRequestModel tamaraRequestModel = new TamaraRequestModel();
if (context != null) GifLoaderDialogUtils.showMyDialog(context);
tamaraRequestModel.merchantReference = transactionID;
tamaraRequestModel.merchantIdentifier = "Tamara";
tamaraRequestModel.clientRequestID = transactionID;
tamaraRequestModel.amount = amount;
tamaraRequestModel.currency = "SR";
tamaraRequestModel.language = await getLanguageID() == 'ar' ? 'AR' : 'EN';
tamaraRequestModel.commandType = "PURCHASE";
tamaraRequestModel.customerEmail = emailId;
tamaraRequestModel.orderDescription = orderDesc;
tamaraRequestModel.isInstallment = true;
tamaraRequestModel.projectID = num.parse(projId);
tamaraRequestModel.accessCode = authUser.mobileNumber;
tamaraRequestModel.appointmentNo = (appoNo != null && appoNo != "") ? appoNo.toString() : "0";
tamaraRequestModel.customerName = patientName;
tamaraRequestModel.fileNumber = patientID.toString();
tamaraRequestModel.patientOutSA = authenticatedUser.outSA == 1 ? true : false;
tamaraRequestModel.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
tamaraRequestModel.latitude = this.lat.toString();
tamaraRequestModel.longitude = this.long.toString();
service.tamaraInsertRequest(tamaraRequestModel, context).then((res) {
if (context != null) GifLoaderDialogUtils.hideDialog(context);
generateTamaraURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate,
appoNo, clinicID, doctorID, "", installments)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);
});
}).catchError((err) {
print(err);
if (context != null) GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
} else {
generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,

@ -222,7 +222,7 @@ class _TextFieldsState extends State<TextFields> {
textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced,
// maxLengthEnforcement: widget.maxLengthEnforced,
initialValue: widget.initialValue,
onChanged: widget.onChanged,
focusNode: _focusNode,

@ -22,7 +22,7 @@ class PhoneNumberSelectorWidget extends StatefulWidget {
class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
var _selectedType = '+966';
String countryCode = '+966';
String countryCode = '966';
List<Countries> counties = [];
ProjectViewModel projectProvider;
@override

Loading…
Cancel
Save