Tamara & Apple Pay Fixes + Other Updates

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

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

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

@ -1847,7 +1847,8 @@ const Map localizedValues = {
"lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" },
"lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" },
"lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" },
"deleteAccount": { "en": "Deactivate my account", "ar": "الحساب احذف" }, "deleteAccount": { "en": "Deactivate Account", "ar": "ايقاف الحساب مؤقتاً" },
"deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد إلغاء تنشيط حسابك؟" }, "deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد ايقاف الحساب مؤقتاً حسابك؟" },
"accountDeactivated": { "en": "Your account has been deactivated successfully", "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; url = BASE_URL + endPoint;
} }
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
@ -96,16 +95,17 @@ class BaseAppClient {
? body['PatientType'] ? body['PatientType']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE : null
: PATIENT_TYPE; : null;
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE_ID : null
: PATIENT_TYPE_ID; : null;
if (user != null) { if (user != null) {
body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
@ -113,8 +113,8 @@ class BaseAppClient {
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
? body['PatientOutSA'] ? body['PatientOutSA']
: PATIENT_OUT_SA : user['OutSA']
: PATIENT_OUT_SA; : user['OutSA'];
body['SessionID'] = getSessionId(body['TokenID']); //getSe body['SessionID'] = getSessionId(body['TokenID']); //getSe
headers = { headers = {
@ -130,8 +130,8 @@ class BaseAppClient {
} }
// body['IdentificationNo'] = 1098574195; // body['IdentificationNo'] = 1098574195;
// body['MobileNo'] = "966565001080"; // body['MobileNo'] = "537503378";
// body['PatientID'] = 3235660; //3844083 // body['PatientID'] = 1231755; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -140,11 +140,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
if (BASE_URL == "https://uat.hmgwebservices.com/") { // if (AppGlobal.isNetworkDebugEnabled) {
debugPrint("URL : $url"); print("URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
debugPrint(jsonBody); print(jsonBody);
} // }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); 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'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
? body['PatientOutSA'] ? body['PatientOutSA']
: PATIENT_OUT_SA : user['OutSA']
: PATIENT_OUT_SA; : user['OutSA'];
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
@ -750,21 +750,21 @@ class BaseAppClient {
? body['PatientType'] ? body['PatientType']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE : user['PatientType']
: PATIENT_TYPE; : user['PatientType'];
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE_ID : user['PatientType']
: PATIENT_TYPE_ID; : user['PatientType'];
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA']; 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()) { if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: { 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', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',

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

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

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

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

@ -44,7 +44,7 @@ List<Map<String, dynamic>> countriesData = [
{ {
"name": "Saudi Arabia", "name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية", "name_ar": "المملكة العربية السعودية",
"code": "+966", "code": "966",
"countryCode": "SA", "countryCode": "SA",
"pattern": "5xxxxxxxx", "pattern": "5xxxxxxxx",
"maxLength": 9 "maxLength": 9
@ -52,7 +52,7 @@ List<Map<String, dynamic>> countriesData = [
{ {
"name": "United Arab Emirates", "name": "United Arab Emirates",
"name_ar": "الإمارات العربية المتحدة", "name_ar": "الإمارات العربية المتحدة",
"code": "+971", "code": "971",
"countryCode": "AE", "countryCode": "AE",
"pattern": "5xxxxxxxx", "pattern": "5xxxxxxxx",
"maxLength": 9 "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, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, // maxLengthEnforced: widget.maxLengthEnforced,
onChanged: widget.onChanged, onChanged: widget.onChanged,
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,

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

@ -47,6 +47,9 @@ class _BookSuccessState extends State<BookSuccess> {
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
String selectedPaymentMethod = ""; String selectedPaymentMethod = "";
String selectedInstallments = "";
String tamaraPaymentStatus;
String tamaraOrderID;
@override @override
initState() { initState() {
@ -537,9 +540,15 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectName = widget.patientShareResponse.projectName; appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { Navigator.push(
setState(() {}); context,
}))).then((value) { FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) {
if (value != null) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); 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'); 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 { 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); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
selectedInstallments = paymentMethod[1];
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
@ -576,6 +586,12 @@ class _BookSuccessState extends State<BookSuccess> {
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
print(url); print(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -594,7 +610,71 @@ class _BookSuccessState extends State<BookSuccess> {
} }
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { 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) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

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

@ -38,9 +38,13 @@ class CovidPaymentSummary extends StatefulWidget {
} }
class _CovidPaymentSummaryState extends State<CovidPaymentSummary> { class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
ProjectViewModel projectViewModel;
String tamaraPaymentStatus;
String tamaraOrderID;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -102,13 +106,16 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
mFlex(1), mFlex(1),
InkWell( InkWell(
onTap: () { onTap: () {
showDraggableDialog(context, PaymentMethod( showDraggableDialog(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { context,
widget.selectedPaymentMethod = metohd; PaymentMethod(
widget.selectedInstallmentPlan = selectedInstallmentPlan; onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {}); widget.selectedPaymentMethod = metohd;
}, widget.selectedInstallmentPlan = selectedInstallmentPlan;
)); setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax,
));
}, },
child: Text( child: Text(
TranslationBase.of(context).changePayment, TranslationBase.of(context).changePayment,
@ -210,7 +217,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Covid appointment payment",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress,
@ -234,6 +241,12 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserLoadStart"); print("onBrowserLoadStart");
print(url); print(url);
if (widget.selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -253,7 +266,74 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); 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) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

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

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

@ -61,6 +61,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
TabController _tabController; TabController _tabController;
String selectedPaymentMethod = "";
String selectedInstallments = "";
String tamaraPaymentStatus;
String tamaraOrderID;
@override @override
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
@ -889,6 +894,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
print(url); print(url);
// Uri myUri = Uri.parse(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) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -908,9 +921,85 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); 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) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String txn_ref; String txn_ref;
num amount; num amount;
@ -986,10 +1075,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { Navigator.push(
setState(() {}); context,
}))).then((value) { FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) {
print(value); print(value);
selectedPaymentMethod = value[0];
selectedInstallments = value[1];
getPatientAppointmentHistory(); getPatientAppointmentHistory();
if (value != null) { if (value != null) {

@ -15,8 +15,10 @@ import 'package:provider/provider.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function onSelectedMethod;
bool isShowInstallments; bool isShowInstallments;
num patientShare;
bool isFromAdvancePayment;
PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false}); PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false, this.patientShare, this.isFromAdvancePayment = false});
@override @override
_PaymentMethodState createState() => _PaymentMethodState(); _PaymentMethodState createState() => _PaymentMethodState();
@ -27,9 +29,23 @@ class _PaymentMethodState extends State<PaymentMethod> {
TamaraInstallmentDetails tamaraInstallmentDetails; TamaraInstallmentDetails tamaraInstallmentDetails;
String selectedInstallmentPlan; String selectedInstallmentPlan;
num minTamaraLimit = 0;
num maxTamaraLimit = 0;
ProjectViewModel projectViewModel;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) {
getTamaraPaymentDetails();
});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).paymentMethod, appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true, 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( Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -227,7 +243,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/tamara.png"), child: SvgPicture.asset("assets/images/new/payment/tamara.svg"),
), ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "TAMARA") if (selectedPaymentMethod == "TAMARA")
@ -503,9 +519,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
setState(() { setState(() {
selectedPaymentMethod = selectedMethod; selectedPaymentMethod = selectedMethod;
}); });
if (selectedMethod == "TAMARA") { // if (selectedMethod == "TAMARA") {
getTamaraPaymentDetails(); // getTamaraPaymentDetails();
} // }
} }
getTamaraPaymentDetails() { getTamaraPaymentDetails() {
@ -514,6 +530,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
service.getTamaraPaymentDetails(context).then((res) { service.getTamaraPaymentDetails(context).then((res) {
tamaraInstallmentDetails = TamaraInstallmentDetails.fromJson(res); tamaraInstallmentDetails = TamaraInstallmentDetails.fromJson(res);
print(tamaraInstallmentDetails.name); print(tamaraInstallmentDetails.name);
minTamaraLimit = tamaraInstallmentDetails.supportedInstalments[0].minLimit.amount;
maxTamaraLimit = tamaraInstallmentDetails.supportedInstalments[0].maxLimit.amount;
selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[0].instalments.toString(); selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[0].instalments.toString();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() {}); 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/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.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/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/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; 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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.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/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
@ -287,73 +286,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
super.initState(); super.initState();
PushNotificationHandler.getInstance().onResume(); 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); WidgetsBinding.instance.addObserver(this);
AppGlobal.context = context; AppGlobal.context = context;
@ -363,7 +295,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
// locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
@ -377,6 +308,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token); print("Firebase Token: " + token);
sharedPref.setString(PUSH_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) { if (token != null) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
if (!projectViewModel.isLoginChild) { if (!projectViewModel.isLoginChild) {
@ -422,8 +360,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
login() async { login() async {
dummyCall(); // dummyCall();
return; // return;
// FirebaseCrashlytics.instance.crash();
// return;
var data = await sharedPref.getObject(IMEI_USER_DATA); var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
@ -451,44 +391,59 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
dummyCall() async { 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( String caller = callerId.split("*")[3];
context, String receiver = callerId.split("*")[4];
title: "Select Server", String host = callerId.split("*")[5];
items: ["https://livecareturn.hmg.com:8086", "https://104.197.179.1:8086"] await Navigator.push(context, MaterialPageRoute(builder: (context) => StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host)));
).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)));
} }
getNotificationCount(token) async { getNotificationCount(token) async {

@ -235,18 +235,18 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
MaterialPageRoute( MaterialPageRoute(
// fullscreenDialog: true, // fullscreenDialog: true,
builder: (BuildContext context) { builder: (BuildContext context) {
final caller = widget.incomingCallData.callerID; // final caller = widget.incomingCallData.callerID;
final receiver = widget.incomingCallData.receiverID; // final receiver = widget.incomingCallData.receiverID;
final host = widget.incomingCallData.server; // final host = widget.incomingCallData.server;
if(widget.incomingCallData.isWebRTC == "true"){ // if(widget.incomingCallData.isWebRTC == "true"){
return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host); // return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
}else{ // }else{
return OpenTokConnectCallPage( return OpenTokConnectCallPage(
apiKey: OPENTOK_API_KEY, apiKey: OPENTOK_API_KEY,
sessionId: widget.incomingCallData.sessionId, sessionId: widget.incomingCallData.sessionId,
token: widget.incomingCallData.token token: widget.incomingCallData.token
); );
} // }
// return VideoCallWebPage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // Web WebRTC VideoCall // 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 selectedPaymentMethod = "";
String amount = ""; String amount = "";
String tamaraPaymentStatus;
String tamaraOrderID;
String selectedInstallmentPlan;
@override @override
void initState() { void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse(); liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -287,12 +291,18 @@ class _clinic_listState extends State<ClinicList> {
}); });
} }
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { Navigator.push(
setState(() {}); context,
}))).then((value) { FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
patientShare: num.parse(getERAppointmentFeesList.total),
))).then((value) {
print(value); print(value);
if (value != null) { 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'); 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); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
selectedInstallmentPlan = paymentMethod[1];
this.amount = amount.toString(); this.amount = amount.toString();
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0], 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("onBrowserLoadStart");
print(url); print(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser.isOpened()) browser.close(); if (browser.isOpened()) browser.close();
@ -331,7 +348,49 @@ class _clinic_listState extends State<ClinicList> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); 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) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

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

@ -192,7 +192,7 @@ class _ForgotPassword extends State<ForgotPassword> {
final authService = new AuthProvider(); final authService = new AuthProvider();
var request = { var request = {
"LogInTokenID": token, "LogInTokenID": token,
"PatientOutSA": countryCode == '966' ? 0 : 1, "PatientOutSA": (countryCode == '966' || countryCode == '+966') ? 0 : 1,
"PatientMobileNumber": mobileNo, "PatientMobileNumber": mobileNo,
"ZipCode": countryCode, "ZipCode": countryCode,
"activationCode": value, "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/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -30,7 +31,6 @@ import 'package:flutter/rendering.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class Login extends StatefulWidget { class Login extends StatefulWidget {
@override @override
_Login createState() => _Login(); _Login createState() => _Login();
} }
@ -255,22 +255,30 @@ class _Login extends State<Login> {
} }
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService authService.checkPatientAuthentication(request).then((value) {
.checkPatientAuthentication(request) if (value['UserAccountIsActivated']) {
.then((value) => { if (value['isSMSSent']) {
if (value['isSMSSent']) sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);
{ sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request);
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), GifLoaderDialogUtils.hideDialog(context);
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), Navigator.of(context).push(FadePage(page: ConfirmLogin()));
GifLoaderDialogUtils.hideDialog(context), } else {
Navigator.of(context).push(FadePage(page: ConfirmLogin())), if (value['IsAuthenticated']) {
} this.checkActivationCode();
else }
{ }
if (value['IsAuthenticated']) {this.checkActivationCode()} } else {
} ConfirmDialog activationDialog = new ConfirmDialog(
}) context: context,
.catchError((err) { 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); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, 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 { checkActivationCode({code}) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
if (code == null) request['PatientMobileNumber'] = int.parse(mobileNo); 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, "PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": registerInfo.idNumber, "PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber, "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, "FirstNameN": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn, "FirstName": registerInfo.firstNameEn,
"MiddleNameN": registerInfo.secondNameAr, "MiddleNameN": registerInfo.secondNameAr,

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

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

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

@ -53,7 +53,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology.doctorRate, finalRadiology.doctorRate,
finalRadiology.actualDoctorRate, finalRadiology.actualDoctorRate,
finalRadiology.noOfPatientsRate, finalRadiology.noOfPatientsRate,
model.user.emailAddress, projectViewModel.user.emailAddress,
), ),
onTap: () { onTap: () {
showConfirmMessage(finalRadiology: finalRadiology, model: model, userObj: projectViewModel.user); 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/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -45,7 +47,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(21.0), padding: const EdgeInsets.only(left: 21, right: 21, top: 21),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -215,15 +217,15 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
mHeight(8), mHeight(8),
inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact), inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact),
mHeight(10), mHeight(10),
InkWell( // InkWell(
onTap: () { // onTap: () {
deactivateAccount(); // deactivateAccount();
}, // },
child: Text( // child: Text(
TranslationBase.of(context).deleteAccount, // TranslationBase.of(context).deleteAccount,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline), // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline),
), // ),
), // ),
mHeight(8), mHeight(8),
], ],
), ),
@ -231,19 +233,30 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
), ),
), ),
Container( Container(
width: double.infinity, padding: EdgeInsets.all(12),
child: Card( color: Colors.white,
margin: EdgeInsets.zero, child: Flex(
elevation: 0, direction: Axis.horizontal,
child: Padding( children: <Widget>[
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 16), Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).save, TranslationBase.of(context).deleteAccount,
() { () {
saveSettings(); 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); GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["IsActive"] = false; 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); AppToast.showSuccessToast(message: TranslationBase.of(context).accountDeactivated);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }
@ -386,6 +400,12 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
request["IsEmailAlertRequired"] = this.emailAlert; request["IsEmailAlertRequired"] = this.emailAlert;
request["IsSMSAlertRequired"] = this.smsAlert; request["IsSMSAlertRequired"] = this.smsAlert;
request["PreferredLanguage"] = this.language.toString(); 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, 'to': session.remote_user?.id,
'from': session.local_user.id, 'from': session.local_user.id,
'candidate': { 'candidate': {
'sdpMLineIndex': candidate.sdpMlineIndex, // sdpMlineIndex or sdpMLineIndex 'sdpMLineIndex': candidate.sdpMLineIndex, // sdpMlineIndex or sdpMLineIndex
'sdpMid': candidate.sdpMid, 'sdpMid': candidate.sdpMid,
'candidate': candidate.candidate, 'candidate': candidate.candidate,
}, },

@ -761,7 +761,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); 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; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -776,6 +776,7 @@ class DoctorsListService extends BaseService {
"AppointmentID": appo.appointmentNo, "AppointmentID": appo.appointmentNo,
"ClinicID": appo.clinicID, "ClinicID": appo.clinicID,
"ProjectID": appo.projectID, "ProjectID": appo.projectID,
"CancelToReschadual": isReschedule,
"EndTime": appo.endTime, "EndTime": appo.endTime,
"StartTime": appo.startTime, "StartTime": appo.startTime,
"DoctorID": appo.doctorID, "DoctorID": appo.doctorID,
@ -1681,4 +1682,49 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); 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/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -59,6 +61,7 @@ class AuthProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
dynamic authenticatedUser; dynamic authenticatedUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
var languageID;
AuthProvider() { AuthProvider() {
getUserAuthentication(); getUserAuthentication();
@ -66,6 +69,7 @@ class AuthProvider with ChangeNotifier {
void getUserAuthentication() async { void getUserAuthentication() async {
Map profile = await sharedPref.getObject(USER_PROFILE); Map profile = await sharedPref.getObject(USER_PROFILE);
languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (profile != null) { if (profile != null) {
isLoading = false; isLoading = false;
isLogin = true; isLogin = true;
@ -167,8 +171,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID; request.languageID = (languageID == 'ar' ? 1 : 2);
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = (request.zipCode == '966' || request.zipCode == '+966') ? 0 : 1;
try { try {
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(CHECK_PATIENT_AUTH, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(CHECK_PATIENT_AUTH, onSuccess: (dynamic response, int statusCode) {
@ -188,8 +192,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID; request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = DeviceTypeID; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
// request.patientTypeID = request.patientType; // request.patientTypeID = request.patientType;
@ -208,8 +212,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID; request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = DeviceTypeID; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
@ -228,8 +232,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.languageID = LANGUAGE_ID; request.languageID = (languageID == 'ar' ? 1 : 2);
request.deviceTypeID = DeviceTypeID; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
@ -252,8 +256,7 @@ class AuthProvider with ChangeNotifier {
neRequest.channel = CHANNEL; neRequest.channel = CHANNEL;
neRequest.iPAdress = IP_ADDRESS; neRequest.iPAdress = IP_ADDRESS;
neRequest.generalid = GENERAL_ID; neRequest.generalid = GENERAL_ID;
// neRequest.languageID = LANGUAGE_ID; neRequest.deviceTypeID = Platform.isIOS ? 1 : 2;
neRequest.deviceTypeID = DeviceTypeID;
neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1;
neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true;
neRequest.isDentalAllowedBackend = false; neRequest.isDentalAllowedBackend = false;
@ -284,8 +287,8 @@ class AuthProvider with ChangeNotifier {
neRequest.channel = CHANNEL; neRequest.channel = CHANNEL;
neRequest.iPAdress = IP_ADDRESS; neRequest.iPAdress = IP_ADDRESS;
neRequest.generalid = GENERAL_ID; neRequest.generalid = GENERAL_ID;
// neRequest.languageID = LANGUAGE_ID; // request.languageID = (languageID == 'ar' ? 1 : 2);
neRequest.deviceTypeID = DeviceTypeID; request.deviceTypeID = Platform.isIOS ? 1 : 2;
neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1;
neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true;
neRequest.isDentalAllowedBackend = false; neRequest.isDentalAllowedBackend = false;
@ -319,8 +322,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.deviceTypeID = DeviceTypeID; request.languageID = (languageID == 'ar' ? 1 : 2);
request.languageID = LANGUAGE_ID; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.isRegister = false; request.isRegister = false;
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
@ -342,8 +345,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.deviceTypeID = DeviceTypeID; request.languageID = (languageID == 'ar' ? 1 : 2);
request.languageID = LANGUAGE_ID; request.deviceTypeID = Platform.isIOS ? 1 : 2;
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
@ -365,8 +368,8 @@ class AuthProvider with ChangeNotifier {
request['Channel'] = CHANNEL; request['Channel'] = CHANNEL;
request['IPAdress'] = IP_ADDRESS; request['IPAdress'] = IP_ADDRESS;
request['Generalid'] = GENERAL_ID; request['Generalid'] = GENERAL_ID;
request['DeviceTypeID'] = DeviceTypeID; request['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
request['LanguageID'] = LANGUAGE_ID; request['LanguageID'] = (languageID == 'ar' ? 1 : 2);
request['LogInTokenID'] = await sharedPref.getString(LOGIN_TOKEN_ID); request['LogInTokenID'] = await sharedPref.getString(LOGIN_TOKEN_ID);
var nhic = await sharedPref.getObject(NHIC_DATA); var nhic = await sharedPref.getObject(NHIC_DATA);
var requestN = RegisterUserRequest.fromJson(request); var requestN = RegisterUserRequest.fromJson(request);
@ -397,7 +400,7 @@ class AuthProvider with ChangeNotifier {
var request = new RegisteredAuthenticatedUserRequest(); var request = new RegisteredAuthenticatedUserRequest();
request.deviceToken = deviceToken; request.deviceToken = deviceToken;
request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); 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.patientMobileNumber = user.mobileNumber[0] == '0' ? user.mobileNumber : '0' + user.mobileNumber;
request.nationalID = user.patientIdentificationNo; request.nationalID = user.patientIdentificationNo;
request.gender = user.gender; request.gender = user.gender;
@ -447,15 +450,12 @@ class AuthProvider with ChangeNotifier {
} }
Future<dynamic> forgotPasswordActivation(request, [value]) async { 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['VersionID'] = VERSION_ID;
request['Channel'] = CHANNEL; request['Channel'] = CHANNEL;
request['IPAdress'] = IP_ADDRESS; request['IPAdress'] = IP_ADDRESS;
request['generalid'] = GENERAL_ID; request['generalid'] = GENERAL_ID;
request['LanguageID'] = LANGUAGE_ID; request['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
request['DeviceTypeID'] = DeviceTypeID; request['LanguageID'] = (languageID == 'ar' ? 1 : 2);
dynamic localRes; dynamic localRes;
try { 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; dynamic localRes;
try { try {
await new BaseAppClient().post(DEACTIVATE_ACCOUNT, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(DEACTIVATE_ACCOUNT, onSuccess: (dynamic response, int statusCode) {
@ -547,5 +563,4 @@ class AuthProvider with ChangeNotifier {
model.setState(0, false, null); model.setState(0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
} }

@ -151,6 +151,7 @@ class FamilyFilesProvider with ChangeNotifier {
request.isRegister = false; request.isRegister = false;
request.responseID = responseID; request.responseID = responseID;
request.status = 2; request.status = 2;
request.familyRegionID = zipCode == '966' ? 1 : 2;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -237,7 +238,7 @@ class FamilyFilesProvider with ChangeNotifier {
if (mainUser == true) { if (mainUser == true) {
var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); 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['LoginType'] = await sharedPref.getInt(LAST_LOGIN) ?? 1;
request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString(); request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString();
request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber']; request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber'];
@ -255,7 +256,8 @@ class FamilyFilesProvider with ChangeNotifier {
//const request = new SwitchUserRequest(); //const request = new SwitchUserRequest();
// request['LogInTokenID'] = ''; // 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['PatientMobileNumber'] = switchUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2; request['SearchType'] = 2;
request['SuperUser'] = switchUser.patientID; //currentUser.PatientID; 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/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.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/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -265,9 +266,7 @@ class LiveCareService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
dynamic localRes; dynamic localRes;
await baseAppClient.post(APPLE_PAY_INSERT_REQUEST, onSuccess: (response, statusCode) async { await baseAppClient.post(APPLE_PAY_INSERT_REQUEST, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -314,10 +313,20 @@ class LiveCareService extends BaseService {
return Future.value(localRes); 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 { Future<Map> getOneSignalVOIPToken(String voipToken, BuildContext context) async {
Map<String, dynamic> request; 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 }; request = { "app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0 };
dynamic localRes; dynamic localRes;

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

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

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

@ -2859,6 +2859,7 @@ class TranslationBase {
String get deleteAccount => localizedValues["deleteAccount"][locale.languageCode]; String get deleteAccount => localizedValues["deleteAccount"][locale.languageCode];
String get deactivateAccount => localizedValues["deactivateAccount"][locale.languageCode]; String get deactivateAccount => localizedValues["deactivateAccount"][locale.languageCode];
String get accountDeactivated => localizedValues["accountDeactivated"][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.doctorRate,
widget.patientLabOrder.actualDoctorRate, widget.patientLabOrder.actualDoctorRate,
widget.patientLabOrder.noOfPatientsRate, widget.patientLabOrder.noOfPatientsRate,
model.user.emailAddress), projectViewModel.user.emailAddress),
onTap: widget.onTap, onTap: widget.onTap,
), ),
SizedBox(height: 10), SizedBox(height: 10),

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
@ -607,6 +609,7 @@ class _AppDrawerState extends State<AppDrawer> {
loginAfter(result, context, isMainUser) async { loginAfter(result, context, isMainUser) async {
Utils.hideProgressDialog(); Utils.hideProgressDialog();
String APNSToken = "";
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: !isMainUser); Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: !isMainUser);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
var bloodType = await sharedPref.getString(BLOOD_TYPE); 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/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.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/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -162,7 +163,7 @@ class MyInAppBrowser extends InAppBrowser {
applePayInsertRequest.clinicID = (clinicID != null && clinicID != "") ? clinicID : 0; applePayInsertRequest.clinicID = (clinicID != null && clinicID != "") ? clinicID : 0;
applePayInsertRequest.currency = authenticatedUser.outSA == 1 ? "AED" : "SAR"; applePayInsertRequest.currency = authenticatedUser.outSA == 1 ? "AED" : "SAR";
applePayInsertRequest.customerEmail = emailId; applePayInsertRequest.customerEmail = emailId;
applePayInsertRequest.customerID = num.parse(patientID); applePayInsertRequest.customerID = patientID;
applePayInsertRequest.customerName = patientName; applePayInsertRequest.customerName = patientName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
@ -170,7 +171,7 @@ class MyInAppBrowser extends InAppBrowser {
applePayInsertRequest.projectID = projId; applePayInsertRequest.projectID = projId;
applePayInsertRequest.serviceID = servID; applePayInsertRequest.serviceID = servID;
applePayInsertRequest.channelID = 3; applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = num.parse(patientID); applePayInsertRequest.patientID = patientID;
applePayInsertRequest.patientTypeID = authenticatedUser.patientType; applePayInsertRequest.patientTypeID = authenticatedUser.patientType;
applePayInsertRequest.patientOutSA = authenticatedUser.outSA; applePayInsertRequest.patientOutSA = authenticatedUser.outSA;
applePayInsertRequest.appointmentDate = (appoDate != null && appoDate != "") ? appoDate : null; applePayInsertRequest.appointmentDate = (appoDate != null && appoDate != "") ? appoDate : null;
@ -198,11 +199,43 @@ class MyInAppBrowser extends InAppBrowser {
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}); });
} else if (paymentMethod == "TAMARA") { } else if (paymentMethod == "TAMARA") {
generateTamaraURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo, LiveCareService service = new LiveCareService();
clinicID, doctorID, "", installments) TamaraRequestModel tamaraRequestModel = new TamaraRequestModel();
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT; if (context != null) GifLoaderDialogUtils.showMyDialog(context);
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);
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 { } else {
generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo, 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, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, // maxLengthEnforcement: widget.maxLengthEnforced,
initialValue: widget.initialValue, initialValue: widget.initialValue,
onChanged: widget.onChanged, onChanged: widget.onChanged,
focusNode: _focusNode, focusNode: _focusNode,

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

Loading…
Cancel
Save