Merge branch 'dev_v3.13.6' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

merge-update-with-lab-changes
Aamir Muhammad 2 years ago
commit 881b1fba53

@ -48,7 +48,7 @@ post_install do |installer|
'PERMISSION_CAMERA=1', 'PERMISSION_CAMERA=1',
'PERMISSION_MICROPHONE=1', 'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.calendar ## dart: PermissionGroup.calendar
'PERMISSION_EVENTS=1', 'PERMISSION_EVENTS_FULL_ACCESS=1',
## dart: PermissionGroup.reminders ## dart: PermissionGroup.reminders
'PERMISSION_REMINDERS=1', 'PERMISSION_REMINDERS=1',
] ]

@ -59,6 +59,10 @@
<string>This App requires access to Bluetooth to connect blood pressure &amp; blood sugar devices with the app to analyze the data.</string> <string>This App requires access to Bluetooth to connect blood pressure &amp; blood sugar devices with the app to analyze the data.</string>
<key>NSCalendarsUsageDescription</key> <key>NSCalendarsUsageDescription</key>
<string>This app requires calendar access to set reminders for Virtual &amp; Normal Appointments.</string> <string>This app requires calendar access to set reminders for Virtual &amp; Normal Appointments.</string>
<key>NSCalendarsWriteOnlyAccessUsageDescription</key>
<string>This app requires calendar access to set reminders for Virtual &amp; Normal Appointments.</string>
<key>NSCalendarsFullAccessUsageDescription</key>
<string>This app requires calendar access to set reminders for Virtual &amp; Normal Appointments.</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>This app requires camera access to enable virtual consultation between patient &amp; doctor</string> <string>This app requires camera access to enable virtual consultation between patient &amp; doctor</string>
<key>NSContactsUsageDescription</key> <key>NSContactsUsageDescription</key>

@ -21,14 +21,16 @@ var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:2018/';
var BASE_URL = 'https://uat.hmgwebservices.com/'; var BASE_URL = 'https://uat.hmgwebservices.com/';
//var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'https://webservices.hmg.com/';
// Pharmacy UAT URLsProductDetailService // var BASE_URL = 'http://10.50.100.198:4422/';
// Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -36,6 +38,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_REDIRECT_URL = 'https://bit.ly/AlhabibPharmacy';
// Pharmacy VidaPlus URLs // Pharmacy VidaPlus URLs
// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
@ -335,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
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 = 11.1; var VERSION_ID = 11.3;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

@ -1901,4 +1901,6 @@ const Map localizedValues = {
"habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."},
"cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"},
"validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"},
"locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
}; };

@ -0,0 +1,32 @@
class ProjectDetailListModel {
int? projectID;
String? latitude;
String? longitude;
int? geofenceRadius;
String? checkInQrCode;
ProjectDetailListModel(
{this.projectID,
this.latitude,
this.longitude,
this.geofenceRadius,
this.checkInQrCode});
ProjectDetailListModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
latitude = json['Latitude'];
longitude = json['Longitude'];
geofenceRadius = json['GeofenceRadius'];
checkInQrCode = json['CheckInQrCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['GeofenceRadius'] = this.geofenceRadius;
data['CheckInQrCode'] = this.checkInQrCode;
return data;
}
}

@ -54,15 +54,18 @@ class AncillaryOrdersService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future getOrdersDetails(appointmentNo, orderNo, projectID) async { Future<Map> getOrdersDetails(appointmentNo, orderNo, projectID) async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['AppointmentNo_Vida'] = appointmentNo; body['AppointmentNo_Vida'] = appointmentNo;
body['OrderNo'] = orderNo; body['OrderNo'] = orderNo;
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
hasError = false; hasError = false;
dynamic localRes;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) {
localRes = response;
_ancillaryProcLists = []; _ancillaryProcLists = [];
response['AncillaryOrderProcList'].forEach((item) { response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
}); });
@ -70,5 +73,6 @@ class AncillaryOrdersService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
return Future.value(localRes);
} }
} }

@ -90,7 +90,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isIOS ? 1 : 2; body['DeviceTypeID'] = Platform.isIOS ? 1 : await Utils.isGoogleServicesAvailable() ? 2 : 3;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
// if (!body.containsKey('PatientType')) { // if (!body.containsKey('PatientType')) {

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/main.dart';
@ -9,6 +10,7 @@ class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = []; List<PrivilegeModel> privilegeModelList = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = []; List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
List<HMCProjectListModel> hMCProjectListModel = []; List<HMCProjectListModel> hMCProjectListModel = [];
List<ProjectDetailListModel> projectDetailListModel = [];
Future getPrivilege() async { Future getPrivilege() async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -29,6 +31,12 @@ class PrivilegeService extends BaseService {
hMCProjectListModel.add(HMCProjectListModel.fromJson(item)); hMCProjectListModel.add(HMCProjectListModel.fromJson(item));
}); });
} }
if (response['ProjectDetailList'].length != 0) {
response['ProjectDetailList'].forEach((item) {
projectDetailListModel.add(ProjectDetailListModel.fromJson(item));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -10,11 +10,10 @@ class AnciallryOrdersViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>(); AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
List<AncillaryOrdersListModel> get ancillaryLists =>
_ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails => List<AncillaryOrdersListModel> get ancillaryLists => _ancillaryService.ancillaryLists;
_ancillaryService.ancillaryProcLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails => _ancillaryService.ancillaryProcLists;
Future getOrders() async { Future getOrders() async {
hasError = false; hasError = false;
@ -30,7 +29,7 @@ class AnciallryOrdersViewModel extends BaseViewModel {
Future getOrdersDetails(appointmentNo, orderNo, projectID) async { Future getOrdersDetails(appointmentNo, orderNo, projectID) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID ); await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID);
if (_ancillaryService.hasError) { if (_ancillaryService.hasError) {
error = _ancillaryService.error!; error = _ancillaryService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
@ -53,11 +54,14 @@ class ProjectViewModel extends BaseViewModel {
List<PrivilegeModel> privilegeChildUser = []; List<PrivilegeModel> privilegeChildUser = [];
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = []; List<VidaPlusProjectListModel> _vidaPlusProjectListModel = [];
List<HMCProjectListModel> _hMCProjectListModel = []; List<HMCProjectListModel> _hMCProjectListModel = [];
List<ProjectDetailListModel> _projectDetailListModel = [];
List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel; List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
List<HMCProjectListModel> get hMCProjectListModel => _hMCProjectListModel; List<HMCProjectListModel> get hMCProjectListModel => _hMCProjectListModel;
List<ProjectDetailListModel> get projectDetailListModel => _projectDetailListModel;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
late StreamSubscription subscription; late StreamSubscription subscription;
@ -127,6 +131,11 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
setProjectsDetailList(List<ProjectDetailListModel> projectDetailListModel) {
_projectDetailListModel = projectDetailListModel;
notifyListeners();
}
setHMCProjectList(List<HMCProjectListModel> hMCProjectListModel) { setHMCProjectList(List<HMCProjectListModel> hMCProjectListModel) {
_hMCProjectListModel = hMCProjectListModel; _hMCProjectListModel = hMCProjectListModel;
notifyListeners(); notifyListeners();

@ -161,7 +161,7 @@ class _MyApp extends State<MyApp> {
builder: (_, mchild) { builder: (_, mchild) {
return MediaQuery( return MediaQuery(
data: MediaQuery.of(context).copyWith( data: MediaQuery.of(context).copyWith(
textScaleFactor: 1.0, textScaler: TextScaler.linear(1.0),
), //set desired text scale factor here ), //set desired text scale factor here
child: mchild! child: mchild!
); );

@ -35,7 +35,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientNameTextController = TextEditingController();
TextEditingController _patientIdentificationTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController();
String mobileNo = ""; String mobileNo = "";
late GetAllCitiesResponseModel _selectedCity; GetAllCitiesResponseModel _selectedCity =GetAllCitiesResponseModel();
late GetAllSharedRecordsByStatusList selectedPatientFamily; late GetAllSharedRecordsByStatusList selectedPatientFamily;
@ -297,7 +297,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
} }
String getRelationName() { String getRelationName() {
if (_selectedCity != null) if (_selectedCity?.description != null)
return _selectedCity.description!; return _selectedCity.description!;
else else
return TranslationBase.of(context).selectCity /*TranslationBase.of(context).selectHospital*/; return TranslationBase.of(context).selectCity /*TranslationBase.of(context).selectHospital*/;

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_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/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -23,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AnicllaryOrdersDetails extends StatefulWidget { class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo; final dynamic appoNo;
@ -45,11 +47,15 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
String? selectedInstallmentPlan; String? selectedInstallmentPlan;
List<AncillaryOrderProcDetailsList> selectedProcList = []; List<AncillaryOrderProcDetailsList> selectedProcList = [];
List<AncillaryOrdersListProcListModel> _ancillaryProcLists = [];
String? tamaraPaymentStatus; String? tamaraPaymentStatus;
String? tamaraOrderID; String? tamaraOrderID;
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) {
getAncillaryOrderDetails();
});
super.initState(); super.initState();
} }
@ -57,12 +63,21 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
super.dispose(); super.dispose();
} }
void getAncillaryOrderDetails(AnciallryOrdersViewModel model) { void getAncillaryOrderDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { AncillaryOrdersService ancillaryOrdersService = new AncillaryOrdersService();
addToSelectedProcedures(model); ancillaryOrdersService.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((response) {
_ancillaryProcLists = [];
selectedProcList = [];
if (response['AncillaryOrderProcList'] != null && response['AncillaryOrderProcList'].length != 0) {
response['AncillaryOrderProcList'].forEach((item) {
_ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
});
addToSelectedProcedures();
}
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) { }).catchError((err) {
AppToast.showErrorToast(message: err.toString());
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }
@ -72,83 +87,74 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
localContext = context; localContext = context;
AppGlobal.context = context; AppGlobal.context = context;
return BaseView<AnciallryOrdersViewModel>( return AppScaffold(
onModelReady: (model) { isShowAppBar: true,
// getAncillaryOrderDetails(model); showNewAppBar: true,
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { showNewAppBarTitle: true,
addToSelectedProcedures(model); appBarTitle: TranslationBase.of(context).anicllaryOrders,
}); body: SingleChildScrollView(
}, padding: EdgeInsets.all(12),
builder: (_, model, widget) => AppScaffold( child: _ancillaryProcLists.isNotEmpty
isShowAppBar: true, ? Column(
showNewAppBar: true, children: [
showNewAppBarTitle: true, getPatientInfo(),
baseViewModel: model, getAncillaryDetails(),
appBarTitle: TranslationBase.of(context).anicllaryOrders, ],
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryListsDetails.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryDetails(model),
])
: getNoDataWidget(context),
),
bottomSheet: model.ancillaryListsDetails.length > 0
? Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
width: double.infinity,
// color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
_amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList!.length > 0
? () {
if (getTotalValue() != "0.00") {
makePayment(model);
} else {
autoGenerateInvoice();
}
}
: null,
color: CustomColors.green,
disabledColor: CustomColors.grey2,
),
],
),
) )
: Container(), : getNoDataWidget(context),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
width: double.infinity,
// color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
_amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList.length > 0
? () {
if (getTotalValue() != "0.00") {
makePayment();
} else {
autoGenerateInvoice();
}
}
: null,
color: selectedProcList.length > 0 ? CustomColors.green : CustomColors.grey2,
disabledColor: CustomColors.grey2,
),
],
),
), ),
); );
} }
@ -183,7 +189,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
); );
} }
Widget getPatientInfo(AnciallryOrdersViewModel model) { Widget getPatientInfo() {
return Padding( return Padding(
child: Column( child: Column(
children: [ children: [
@ -276,7 +282,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
model.ancillaryListsDetails[0].appointmentNo.toString(), _ancillaryProcLists[0].appointmentNo.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -299,7 +305,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList![0].orderNo.toString(), _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -324,7 +330,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
mWidth(3), mWidth(3),
Expanded( Expanded(
child: Text( child: Text(
model.ancillaryListsDetails[0].companyName.toString(), _ancillaryProcLists[0].companyName.toString(),
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -349,7 +355,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
model.ancillaryListsDetails[0].insurancePolicyNo.toString(), _ancillaryProcLists[0].insurancePolicyNo.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -369,16 +375,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
); );
} }
// Widget getAncillaryDetails(AnciallryOrdersViewModel model) {
// Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!, (obj) => obj.procedureCategoryName);
// return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap));
// }
// Changed By Aamir
Widget getAncillaryDetails(AnciallryOrdersViewModel model) {
Map<String, List<Object>> newMap = {};
// Grouping the list manually by the 'procedureCategoryName' key Widget getAncillaryDetails() {
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!.forEach((obj) { Map<String, List<Object>> newMap = {};
_ancillaryProcLists[0].ancillaryOrderProcDetailsList!.forEach((obj) {
String key = obj.procedureCategoryName!; String key = obj.procedureCategoryName!;
if (newMap.containsKey(key)) { if (newMap.containsKey(key)) {
newMap[key]!.add(obj); newMap[key]!.add(obj);
@ -511,35 +512,35 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return tableRow; return tableRow;
} }
makePayment(AnciallryOrdersViewModel model) { makePayment() {
showDraggableDialog( showDraggableDialog(
context, context,
PaymentMethod( PaymentMethod(
onSelectedMethod: (String method, [String? selectedInstallmentPlan]) { onSelectedMethod: (String method, [String? selectedInstallmentPlan]) {
selectedPaymentMethod = method; selectedPaymentMethod = method;
this.selectedInstallmentPlan = selectedInstallmentPlan!; this.selectedInstallmentPlan = selectedInstallmentPlan;
openPayment(selectedPaymentMethod, projectViewModel.user!, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), model, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan);
}, },
patientShare: double.parse(getTotalValue()), patientShare: double.parse(getTotalValue()),
isFromAdvancePayment: !projectViewModel!.havePrivilege(94), isFromAdvancePayment: !projectViewModel.havePrivilege(94),
)); ));
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String? selectedInstallmentPlan]) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, [String? selectedInstallmentPlan]) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user!.patientID!); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!);
browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Ancillary Orders Payment", "Ancillary Orders Payment",
transID, transID,
widget.projectID.toString(), widget.projectID.toString(),
projectViewModel.user!.emailAddress!, projectViewModel.user.emailAddress!,
paymentMethod, paymentMethod,
projectViewModel.user!.patientType, projectViewModel.user.patientType,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
projectViewModel.user!.patientID, projectViewModel.user.patientID,
authenticatedUser, authenticatedUser,
browser, browser,
false, false,
@ -547,10 +548,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
// Need to get new Service ID from Ayman for Ancillary Tamara // Need to get new Service ID from Ayman for Ancillary Tamara
"", "",
context, context,
model.ancillaryListsDetails[0].appointmentDate, _ancillaryProcLists[0].appointmentDate,
model.ancillaryListsDetails[0].appointmentNo, _ancillaryProcLists[0].appointmentNo,
model.ancillaryListsDetails[0].clinicID, _ancillaryProcLists[0].clinicID,
model.ancillaryListsDetails[0].doctorID, _ancillaryProcLists[0].doctorID,
selectedInstallmentPlan); selectedInstallmentPlan);
} }
@ -736,16 +737,18 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} }
} }
addToSelectedProcedures(AnciallryOrdersViewModel model) { addToSelectedProcedures() {
if (model.ancillaryListsDetails.isNotEmpty) { if (_ancillaryProcLists.isNotEmpty) {
selectedProcList.clear(); selectedProcList.clear();
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!.forEach((element) { if (_ancillaryProcLists[0].ancillaryOrderProcDetailsList != null) {
if (!isProcedureDisabled(element)) { _ancillaryProcLists[0].ancillaryOrderProcDetailsList!.forEach((element) {
selectedProcList.add(element); if (!isProcedureDisabled(element)) {
} selectedProcList.add(element);
}); }
setState(() {}); });
} else {}
} }
setState(() {});
} }
String getInsuranceText(value) { String getInsuranceText(value) {

@ -94,7 +94,7 @@ class _BookSuccessState extends State<BookSuccess> {
widget.docObject.projectName!, widget.docObject.projectName!,
null, null,
null, null,
widget.docObject.nationalityFlagURL!, widget.docObject.nationalityFlagURL ?? "",
widget.docObject.doctorRate, widget.docObject.doctorRate,
null, null,
widget.docObject.noOfPatientsRate, widget.docObject.noOfPatientsRate,
@ -174,6 +174,7 @@ class _BookSuccessState extends State<BookSuccess> {
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
// navigateToQR(context); // navigateToQR(context);
GifLoaderDialogUtils.showMyDialog(context);
getAppoQR(context); getAppoQR(context);
}, },
child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
@ -190,7 +191,7 @@ class _BookSuccessState extends State<BookSuccess> {
child: Container( child: Container(
color: CustomColors.appBackgroudGreyColor, color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.all(14), margin: EdgeInsets.all(14),
height: 150.0, height: widget.isCash ? 150.0 : 50,
child: Column( child: Column(
children: [ children: [
Row( Row(

@ -3,6 +3,7 @@ import 'dart:typed_data';
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/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -17,7 +18,9 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
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/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.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/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
@ -49,6 +52,8 @@ class _QRCodeState extends State<QRCode> {
late BuildContext _context; late BuildContext _context;
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
late LocationUtils locationUtils;
ProjectDetailListModel projectDetailListModel = ProjectDetailListModel();
@override @override
void initState() { void initState() {
@ -90,6 +95,20 @@ class _QRCodeState extends State<QRCode> {
} else {} } else {}
} }
startLocationCheckIn() async {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) {
projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment!.projectID);
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) {
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
}
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -107,7 +126,7 @@ class _QRCodeState extends State<QRCode> {
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.appointment!.doctorTitle! + " " + widget.appointment!.doctorNameObj!, widget.appointment!.doctorTitle! + " " + widget.appointment!.doctorNameObj!,
widget.appointment!.doctorID!, widget.appointment!.doctorID ?? 0,
widget.appointment!.doctorImageURL!, widget.appointment!.doctorImageURL!,
widget.appointment!.doctorSpeciality!, widget.appointment!.doctorSpeciality!,
"", "",
@ -256,6 +275,24 @@ class _QRCodeState extends State<QRCode> {
), ),
); );
optionsList.add(
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(102)) {
startLocationCheckIn();
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).checkInViaLocation,
imagePath: 'location.svg',
subTitle: "",
isEnable: projectViewModel.havePrivilege(102),
width: 70.0,
height: 70.0,
),
),
);
return optionsList; return optionsList;
} }

@ -1,5 +1,6 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
@ -82,10 +83,10 @@ class _BookReminderPageState extends State<BookReminderPage> {
widget.docObject.projectName!, widget.docObject.projectName!,
null, null,
null, null,
widget.docObject.nationalityFlagURL!, widget.docObject.nationalityFlagURL ?? "",
widget.docObject.doctorRate!, widget.docObject.doctorRate?? 0,
null, null,
widget.docObject.noOfPatientsRate!, widget.docObject.noOfPatientsRate ?? 0,
"", "",
), ),
isNeedToShowButton: false, isNeedToShowButton: false,
@ -188,8 +189,6 @@ class _BookReminderPageState extends State<BookReminderPage> {
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
print(widget.patientShareResponse);
print(widget.patientShareResponse.appointmentNo);
showReminderDialog( showReminderDialog(
context, context,
widget.dateTime!, widget.dateTime!,
@ -201,7 +200,8 @@ class _BookReminderPageState extends State<BookReminderPage> {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context); navigateToBookSuccess(context);
}, },
title: "" title: null,
description: null
); );
projectViewModel.analytics.appointment.appointment_reminder(true); projectViewModel.analytics.appointment.appointment_reminder(true);
}, },

@ -24,28 +24,25 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (await PermissionService.isCalendarPermissionEnabled()) { if (await PermissionService.isCalendarPermissionEnabled()) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
} else { } else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async {
if (await Permission.calendarFullAccess.request().isGranted) { if (await Permission.calendarFullAccess.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
} }
}); });
} }
} else { } else {
if (await Permission.calendarFullAccess.request().isGranted) { if (await Permission.calendarFullAccess.request().isGranted) {
print(await Permission.calendarFullAccess.request().isGranted);
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
} }
} }
} }
final CalendarPlugin _myPlugin = CalendarPlugin();
Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
{required Function onSuccess, required String title, required String description, required Function(int) onMultiDateSuccess}) async { {required Function onSuccess, String? title, String? description, required Function(int) onMultiDateSuccess}) async {
return showDialog<void>( return showDialog<void>(
context: context, context: context,
barrierDismissible: true, // user must tap button! barrierDismissible: true, // user must tap button!
@ -78,17 +75,21 @@ Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String
text = "2 hours"; text = "2 hours";
} }
if (onMultiDateSuccess == null) { if (onMultiDateSuccess.call(i) == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils try {
.createOrUpdateEvent( await calendarUtils.createOrUpdateEvent(
title: title ?? TranslationBase.of(context).reminderTitle + " " + doctorName, title: title ?? TranslationBase
description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted, .of(context)
scheduleDateTime: dateTime, .reminderTitle + " " + doctorName,
eventId: eventId) description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted,
.then((value) {}); scheduleDateTime: dateTime,
eventId: eventId);
onSuccess(); onSuccess();
}catch(e){
print(e);
}
} else { } else {
onMultiDateSuccess(i); onMultiDateSuccess(i);
} }

@ -47,7 +47,7 @@ class AddNewChildPage extends StatefulWidget {
class _AddNewChildPageState extends State<AddNewChildPage> { class _AddNewChildPageState extends State<AddNewChildPage> {
late int tappedIndex; late int tappedIndex;
late int checkedValue; int checkedValue =0;
@override @override
void initState() { void initState() {

@ -1,8 +1,10 @@
import 'dart:collection'; import 'dart:collection';
import 'dart:convert';
import 'package:device_calendar/device_calendar.dart'; import 'package:device_calendar/device_calendar.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
@ -30,7 +32,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'widgets/AppointmentActions.dart'; import 'widgets/AppointmentActions.dart';
class AppointmentDetails extends StatefulWidget { class AppointmentDetails extends StatefulWidget {
@ -50,7 +51,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
static TabController? _tabController; static TabController? _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList =[]; List<DoctorRateDetails> doctorDetailsList = [];
ToDoCountProviderModel? toDoProvider; ToDoCountProviderModel? toDoProvider;
ProjectViewModel? projectViewModel; ProjectViewModel? projectViewModel;
@ -306,10 +307,12 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
context, context,
FadePage( FadePage(
page: BookConfirm( page: BookConfirm(
doctor: getDoctorObject(), doctor: getDoctorObject(),
isLiveCareAppointment: widget.appo.isLiveCareAppointment!, isLiveCareAppointment: widget.appo.isLiveCareAppointment!,
selectedDate: DocAvailableAppointments.selectedDate!, selectedDate: DocAvailableAppointments.selectedDate!,
selectedTime: DocAvailableAppointments.selectedTime!, initialSlotDuration: 0,))); selectedTime: DocAvailableAppointments.selectedTime!,
initialSlotDuration: 0,
)));
} }
void getDoctorRatingsDetails() { void getDoctorRatingsDetails() {
@ -357,41 +360,50 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))), child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))),
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate!.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate!.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
alignment: Alignment.center, Container(
child: margin: EdgeInsets.only(top: 5.0),
// RatingBar.readOnly( alignment: Alignment.center,
// initialRating: this.widget.appo.actualDoctorRate.toDouble(), child:
// size: 35.0, // RatingBar.readOnly(
// filledColor: Colors.yellow[700], // initialRating: this.widget.appo.actualDoctorRate.toDouble(),
// emptyColor: Colors.grey[500], // size: 35.0,
// isHalfAllowed: true, // filledColor: Colors.yellow[700],
// halfFilledIcon: Icons.star_half, // emptyColor: Colors.grey[500],
// filledIcon: Icons.star, // isHalfAllowed: true,
// emptyIcon: Icons.star, // halfFilledIcon: Icons.star_half,
// ), // filledIcon: Icons.star,
RatingBar( // emptyIcon: Icons.star,
initialRating: this.widget.appo.actualDoctorRate!.toDouble(), // ),
direction: Axis.horizontal, RatingBar(
allowHalfRating: true, initialRating: this.widget.appo.actualDoctorRate!.toDouble(),
itemCount: 5, direction: Axis.horizontal,
itemSize: 20, allowHalfRating: true,
ignoreGestures: true, itemCount: 5,
ratingWidget: RatingWidget( itemSize: 20,
full: Icon(Icons.star, color: CustomColors.accentColor,), ignoreGestures: true,
half: Icon(Icons.star_half, color: CustomColors.accentColor,), ratingWidget: RatingWidget(
empty: Icon(Icons.star, color: CustomColors.accentColor,), full: Icon(
), Icons.star,
tapOnlyMode: true, color: CustomColors.accentColor,
unratedColor: Colors.grey[500], ),
itemPadding: EdgeInsets.symmetric(horizontal: 4.0), half: Icon(
onRatingUpdate: (rating) { Icons.star_half,
print(rating); color: CustomColors.accentColor,
}, ),
) empty: Icon(
), Icons.star,
color: CustomColors.accentColor,
),
),
tapOnlyMode: true,
unratedColor: Colors.grey[500],
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
)),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text(this.widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))), child: Text(this.widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))),
@ -510,10 +522,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
minWidth: MediaQuery.of(context).size.width, minWidth: MediaQuery.of(context).size.width,
height: 40.0, height: 40.0,
child: CustomTextButton( child: CustomTextButton(
elevation: 0.0, elevation: 0.0,
backgroundColor: Colors.white, backgroundColor: Colors.white,
disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38), disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38),
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@ -612,15 +624,24 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
DateTime startEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!); DateTime startEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!);
DateTime endEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!); DateTime endEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!);
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
if (calendarUtils.calendars.length > 1) {
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id!, params).then((value) { calendarUtils.calendars.forEach((calender) {
Result<UnmodifiableListView<Event>> events = value; calendarUtils.retrieveEvents(calender.id!, params).then((value) {
events.data!.forEach((element) { Result<UnmodifiableListView<Event>> events = value;
if (element.title!.contains(widget.appo.doctorNameObj!)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); events.data!.forEach((element) {
if (element.title!.contains(widget.appo.doctorNameObj!)) calendarUtils.deleteEvent(calender, element);
});
});
}); });
}); } else {
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id!, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data!.forEach((element) {
if (element.title!.contains(widget.appo.doctorNameObj!)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element);
});
});
}
} }
cancelAppointment() { cancelAppointment() {

@ -38,6 +38,7 @@ class BookedButtons {
"subtitle": TranslationBase.of(AppGlobal.context).location, "subtitle": TranslationBase.of(AppGlobal.context).location,
"icon": "hosp_location.svg", "icon": "hosp_location.svg",
"caller": "navigateToProject", "caller": "navigateToProject",
} },
{"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"}
]; ];
} }

@ -34,11 +34,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profil
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:map_launcher/map_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'dart:io';
import 'package:huawei_map/huawei_map.dart' as hmsMap;
class AppointmentActions extends StatefulWidget { class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
@ -55,10 +59,13 @@ class AppointmentActions extends StatefulWidget {
class _AppointmentActionsState extends State<AppointmentActions> { class _AppointmentActionsState extends State<AppointmentActions> {
List<AppoDetailsButton> appoButtonsList = []; List<AppoDetailsButton> appoButtonsList = [];
static bool isHuawei =false;
late HmsApiAvailability hmsApiAvailability;
@override @override
void initState() { void initState() {
_getAppointmentActionButtons(); _getAppointmentActionButtons();
checkIsHuawei();
super.initState(); super.initState();
} }
@ -73,6 +80,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") ||
(widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc") || (widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc") ||
(Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID!) && (Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID!) &&
@ -181,7 +189,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
_getConfirmedAppoActionsList(); _getConfirmedAppoActionsList();
} }
} else { } else {
print("isConfirmed dynamic"); print("isConfirmed Null");
} }
if (isBooked()) { if (isBooked()) {
if (widget.appo.isOnlineCheckedIN!) { if (widget.appo.isOnlineCheckedIN!) {
@ -190,7 +198,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
_getBookedAppoActionsList(); _getBookedAppoActionsList();
} }
} else { } else {
print("isBooked dynamic"); print("isBooked Null");
} }
if (isArrived()) { if (isArrived()) {
if (widget.appo.clinicID == 17) { if (widget.appo.clinicID == 17) {
@ -199,10 +207,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
_getArrivedAppoActionsList(); _getArrivedAppoActionsList();
} }
} else { } else {
print("isArrived dynamic"); print("isArrived Null");
} }
} else { } else {
print("Appo dynamic"); print("Appo Null");
} }
} }
@ -455,13 +463,22 @@ class _AppointmentActionsState extends State<AppointmentActions> {
static Future<void> openMap(double latitude, double longitude) async { static Future<void> openMap(double latitude, double longitude) async {
await MapLauncher.showMarker( await MapLauncher.showMarker(
mapType: MapType.google, mapType: Platform.isAndroid ? isHuawei == true ? MapType.petal: MapType.google : MapType.apple,
coords: Coords(latitude, longitude), coords: Coords(latitude, longitude),
title: "Sulaiman Al Habib", title: "Sulaiman Al Habib",
description: "Appointment Location", description: "Appointment Location",
); );
} }
checkIsHuawei() async {
if( Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) {
isHuawei = value == 0 ? true : false;
hmsMap.HuaweiMapInitializer.initializeMap();
});
print(isHuawei);
}
}
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -586,30 +603,51 @@ class _AppointmentActionsState extends State<AppointmentActions> {
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel!.isLogin) { if (widget.projectViewModel!.isLogin) {
if (model.count != 0) { // if (model.count != 0) {
Navigator.push( getPatientAppointmentHistoryWithAppo();
context, }
FadePage( // else {
page: ToDo( // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
isShowAppBar: true, // }
isFromMyAppointments: true, else {
appointment: widget.appo,
)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
} else {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ToDo( page: ToDo(
isShowAppBar: true, isShowAppBar: true,
isFromMyAppointments: true, isFromMyAppointments: true,
appointment: widget.appo, appointment: widget.appo,
))); )));
} }
} }
getPatientAppointmentHistoryWithAppo() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]);
Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: appo,
),
),
);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err);
});
}
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -568,9 +568,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
performNextAction(AppoitmentAllHistoryResultList appo) { performNextAction(AppoitmentAllHistoryResultList appo) {
switch (appo.nextAction) { switch (appo.nextAction) {
case 0:
// getAppoQR(context, appo);
break;
case 10: case 10:
confirmAppointment(appo); confirmAppointment(appo);
break; break;
case 15:
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingPaymentPending);
break;
case 20: case 20:
getPatientShare(context, appo); getPatientShare(context, appo);
// checkPatientNphiesEligibility(context, appo); // checkPatientNphiesEligibility(context, appo);
@ -859,7 +865,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
dataLoaded = true; dataLoaded = true;
if (widget.isFromMyAppointments) { if (widget.isFromMyAppointments) {
getPatientShare(context, widget.appointment!); performNextAction(widget.appointment!);
widget.isFromMyAppointments = false;
} }
}); });
} else { } else {

@ -422,7 +422,8 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick!(); if (projectViewModel.havePrivilege(100))
widget.onPharmacyClick!();
}, },
child: Stack(children: [ child: Stack(children: [
Container( Container(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -11,6 +12,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'fragments/home_page_fragment2.dart'; import 'fragments/home_page_fragment2.dart';
import 'landing_page_pharmcy.dart'; import 'landing_page_pharmcy.dart';
@ -48,7 +51,9 @@ class _HomePageState2 extends State<HomePage2> {
widget.onLoginClick!(); widget.onLoginClick!();
}, },
onPharmacyClick: () { onPharmacyClick: () {
getPharmacyToken(model); // getPharmacyToken(model);
Uri uri = Uri.parse(PHARMACY_REDIRECT_URL);
launchUrl(uri, mode: LaunchMode.externalApplication);
}, },
onMedicalFileClick: () { onMedicalFileClick: () {
widget.onMedicalFileClick!(); widget.onMedicalFileClick!();

@ -641,7 +641,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
projectViewModel.analytics.setUser(AuthenticatedUser()); projectViewModel.analytics.setUser(AuthenticatedUser());
} }
if (Platform.isIOS) { if (Platform.isIOS) {
String voipToken = await sharedPref.getString(APNS_TOKEN); String? voipToken = await sharedPref.getString(APNS_TOKEN?? "");
// getOneSignalVOIPToken(voipToken); // getOneSignalVOIPToken(voipToken);
} }
} }

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.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/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -209,7 +210,9 @@ class ServicesView extends StatelessWidget {
Navigator.push(context, FadePage(page: CMCPage())); Navigator.push(context, FadePage(page: CMCPage()));
locator<GAnalytics>().hmgServices.logServiceName('comprehensive medical checkup'); locator<GAnalytics>().hmgServices.logServiceName('comprehensive medical checkup');
} else if (hmgServices.action == 5) { } else if (hmgServices.action == 5) {
getPharmacyToken(context); // getPharmacyToken(context);
Uri uri = Uri.parse(PHARMACY_REDIRECT_URL);
launchUrl(uri, mode: LaunchMode.externalApplication);
locator<GAnalytics>().hmgServices.logServiceName('al habib pharmacy'); locator<GAnalytics>().hmgServices.logServiceName('al habib pharmacy');
} else if (hmgServices.action == 6) { } else if (hmgServices.action == 6) {
Navigator.push(context, FadePage(page: MedicalProfilePageNew())); Navigator.push(context, FadePage(page: MedicalProfilePageNew()));

@ -47,16 +47,16 @@ class DoctorsListService extends BaseService {
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); // Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2, // "LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", // "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, // "VersionID": req.VersionID,
"Channel": req.Channel, // "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', // "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, // "DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
@ -393,10 +393,8 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async { await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
logger.d(error);
throw error; throw error;
}, body: request); }, body: request);
logger.d(localRes);
return Future.value(localRes); return Future.value(localRes);
} catch (e) { } catch (e) {
logger.d(e); logger.d(e);
@ -619,6 +617,19 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientAppointmentHistoryWithAppoNo(int appoNo) async {
Map<String, dynamic> request;
request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;

@ -18,19 +18,7 @@ class ClinicListService extends BaseService {
late double long; late double long;
Future<Map> getClinicsList(context) async { Future<Map> getClinicsList(context) async {
Map<String, dynamic> request; Map<String, dynamic> request = {};
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes; dynamic localRes;
@ -44,21 +32,10 @@ class ClinicListService extends BaseService {
} }
Future<Map> getActiveAppointmentNo(context) async { Future<Map> getActiveAppointmentNo(context) async {
Map<String, dynamic> request; Map<String, dynamic> request = {};
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": user.outSA,
"IsActiveAppointment": true, "IsActiveAppointment": true,
// "DeviceTypeID": req.DeviceTypeID,
// "PatientType": user.patientType,
// "PatientTypeID": user.patientType,
// "SessionID": null
}; };
dynamic localRes; dynamic localRes;
@ -72,19 +49,7 @@ class ClinicListService extends BaseService {
} }
Future<Map> getProjectsList(context) async { Future<Map> getProjectsList(context) async {
Map<String, dynamic> request; Map<String, dynamic> request = {};
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes; dynamic localRes;
@ -113,9 +78,9 @@ class ClinicListService extends BaseService {
"SelectedDate": "", "SelectedDate": "",
"SelectedTime": "", "SelectedTime": "",
"License": true, "License": true,
"VersionID": 5.6, // "VersionID": 5.6,
"Channel": 3, // "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2, // "LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"SessionID": null, "SessionID": null,
@ -155,11 +120,11 @@ class ClinicListService extends BaseService {
request = { request = {
"ChiefComplaintID": chiefComplaintID, "ChiefComplaintID": chiefComplaintID,
"ProjectID": projectID, "ProjectID": projectID,
"VersionID": 5.6, // "VersionID": 5.6,
"Channel": 3, // "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2, // "LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, // "IPAdress": req.IPAdress,
"generalid": req.generalid, // "generalid": req.generalid,
"SessionID": null, "SessionID": null,
"isDentalAllowedBackend": true, "isDentalAllowedBackend": true,
"Latitude": lat != null ? lat.toString() : "0.0", "Latitude": lat != null ? lat.toString() : "0.0",

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
@ -33,9 +34,8 @@ class _SplashScreenState extends State<SplashScreen> {
super.initState(); super.initState();
Timer( Timer(
Duration(seconds: 1, milliseconds: 500), Duration(seconds: 1, milliseconds: 500),
() { () async {
loadPrivilege().then((value) { await loadPrivilege().then((value) {
print(value);
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => LandingPage(), builder: (BuildContext context) => LandingPage(),
@ -46,8 +46,8 @@ 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));
}); });
} }
@ -58,11 +58,11 @@ class _SplashScreenState extends State<SplashScreen> {
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel);
projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel); projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel);
projectProvider.setProjectsDetailList(_privilegeService.projectDetailListModel);
AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch
AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); 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'));
// if (Platform.isIOS)
PushNotificationHandler.getInstance().init(context); // Asyncronously PushNotificationHandler.getInstance().init(context); // Asyncronously
} }

@ -59,7 +59,7 @@ class CalendarUtils {
}); });
} }
Future createOrUpdateEvent({String? title, String? description, DateTime? scheduleDateTime, String? eventId}) async { Future createOrUpdateEvent({required String title, required String description, DateTime? scheduleDateTime, String? eventId}) async {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
// daysOfWeek: daysOfWeek, // daysOfWeek: daysOfWeek,
@ -74,7 +74,7 @@ class CalendarUtils {
TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation); TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation);
// print("eventId: " + eventId); //print("eventId: " + eventId);
// print("writableCalendars-name: " + writableCalendars.name); // print("writableCalendars-name: " + writableCalendars.name);
// print("writableCalendars-Id: " + writableCalendars.id); // print("writableCalendars-Id: " + writableCalendars.id);
// print("writableCalendarsToString: " + writableCalendars.toString()); // print("writableCalendarsToString: " + writableCalendars.toString());

@ -128,8 +128,8 @@ class LocationUtils {
heading: 0.0, heading: 0.0,
speed: 0.0, speed: 0.0,
speedAccuracy: 1, speedAccuracy: 1,
altitudeAccuracy: 0, altitudeAccuracy: 0,
headingAccuracy: 0, headingAccuracy: 0,
// Added by Aamir // Added by Aamir
), ),
); );

@ -2910,6 +2910,8 @@ class TranslationBase {
String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode];
String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode];
String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode];
String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode];
String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode];
} }

@ -10,6 +10,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:crypto/crypto.dart' as crypto; import 'package:crypto/crypto.dart' as crypto;
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/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
@ -45,6 +46,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_api_availability/google_api_availability.dart'; import 'package:google_api_availability/google_api_availability.dart';
import 'dart:math' show asin, cos, pi, pow, sin, sqrt;
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -803,6 +805,24 @@ class Utils {
return false; return false;
} }
static double distance(double lat1, double lon1, double lat2, double lon2) {
const r = 6372.8; // Earth radius in kilometers
final dLat = _toRadians(lat2 - lat1);
final dLon = _toRadians(lon2 - lon1);
final lat1Radians = _toRadians(lat1);
final lat2Radians = _toRadians(lat2);
final a = _haversin(dLat) + cos(lat1Radians) * cos(lat2Radians) * _haversin(dLon);
final c = 2 * asin(sqrt(a));
return r * c;
}
static double _toRadians(double degrees) => degrees * pi / 180;
static num _haversin(double radians) => pow(sin(radians / 2), 2);
static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) { static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -851,9 +871,17 @@ class Utils {
return isHMCProject; return isHMCProject;
} }
// static String generateSignature() { static ProjectDetailListModel getProjectDetailObj(ProjectViewModel projectViewModel, int projectID) {
// ProjectDetailListModel projectDetailListModel = ProjectDetailListModel();
// } projectViewModel.projectDetailListModel.forEach((element) {
if (element.projectID == projectID) {
projectDetailListModel = element;
}
});
return projectDetailListModel;
}
//static String generateSignature() {}
} }
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) { Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) {

@ -68,7 +68,6 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'package:speech_to_text/speech_to_text.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class FloatingSearchButton extends StatefulWidget { class FloatingSearchButton extends StatefulWidget {
@ -144,7 +143,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
if (p['startPopUp'] == 'true') { if (p['startPopUp'] == 'true') {
if (this.mounted) { if (this.mounted) {
new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
// initSpeechState().then((value) => {startVoiceSearch()}); initSpeechState().then((value) => {startVoiceSearch()});
} }
} }
}); });
@ -259,16 +258,19 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
// } // }
// some time later... // some time later...
if(available) { if(available) {
speech.stop();
// speech.listen( onResult: resultListener );
// speech.stop();
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
listenFor: Duration(seconds: 10), listenFor: Duration(seconds: 10),
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
onSoundLevelChange: soundLevelListener, onSoundLevelChange: soundLevelListener,
cancelOnError: true, // cancelOnError: true,
partialResults: true, // partialResults: true,
onDevice: true, // onDevice: true,
listenMode: ListenMode.deviceDefault); // listenMode: stt.ListenMode.deviceDefault
);
} }
} }

@ -1,7 +1,7 @@
name: diplomaticquarterapp name: diplomaticquarterapp
description: A new Flutter application. description: A new Flutter application.
version: 4.5.029+4050029 version: 4.5.73+1
environment: environment:
sdk: ">=3.0.0 <3.13.0" sdk: ">=3.0.0 <3.13.0"
@ -121,7 +121,7 @@ dependencies:
flutter_datetime_picker_plus: ^2.1.0 flutter_datetime_picker_plus: ^2.1.0
carousel_pro_nullsafety: ^2.0.0 carousel_pro_nullsafety: ^2.0.0
flutter_local_notifications: any flutter_local_notifications: any
device_calendar: ^4.2.0 device_calendar: ^4.3.2
geolocator: ^9.0.2 geolocator: ^9.0.2
geocoding: ^2.0.1 geocoding: ^2.0.1
jiffy: ^6.2.1 jiffy: ^6.2.1

Loading…
Cancel
Save