Updates, fixes & release VersionID 9.1

development_v2.5
haroon amjad 2 years ago
parent 21cf9da900
commit dfa88b7de7

@ -408,7 +408,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 8.9;
var VERSION_ID = 9.1;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;

@ -78,6 +78,9 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT);
body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG);
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
@ -130,7 +133,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1098574195;
// body['MobileNo'] = "537503378";
// body['PatientID'] = 1231755; //3844083
// body['PatientID'] = 1018977; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
@ -139,11 +142,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null);
// if (AppGlobal.isNetworkDebugEnabled) {
if (AppGlobal.isNetworkDebugEnabled) {
print("URL : $url");
final jsonBody = json.encode(body);
print(jsonBody);
// }
}
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -57,7 +57,6 @@ class HospitalService extends BaseService {
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['PatientOutSA'] = 0;
await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();

@ -18,13 +18,14 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
await _pharmacyModuleService.generatePharmacyToken().then((value) async {
// await _customerAddressesService.getCustomerInfo();
// await _customerAddressesService.getCustomerInfo();
await _pharmacyModuleService.createUser();
await _pharmacyModuleService.createUser().then((value) async {
await getCustomerAddresses();
});
});
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {}
await getCustomerAddresses();
}
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID, int projectID}) async {

@ -35,6 +35,12 @@ class ProjectViewModel extends BaseViewModel {
bool isLogin = false;
int laserSelectionDuration;
double _latitude;
double _longitude;
double get latitude => _latitude;
double get longitude => _longitude;
dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale;
@ -74,6 +80,12 @@ class ProjectViewModel extends BaseViewModel {
});
}
void setLatitudeLongitude(double lat, double long) {
_latitude = lat;
_longitude = long;
notifyListeners();
}
Future loadSharedPrefLanguage() async {
currentLanguage =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');

@ -93,7 +93,6 @@ class OrdersLogDetailsPage extends StatelessWidget {
],
),
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(

@ -18,6 +18,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
@ -28,11 +29,11 @@ import 'package:provider/provider.dart';
class LocationPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
// final double latitude;
// final double longitude;
final dynamic model;
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) : super(key: key);
const LocationPage({Key key, this.onPick, this.model}) : super(key: key);
@override
_LocationPageState createState() => _LocationPageState();
@ -58,40 +59,44 @@ class _LocationPageState extends State<LocationPage> {
// Completer<GoogleMapController> mapController = Completer();
Placemark selectedPlace;
HmsApiAvailability hmsApiAvailability;
ProjectViewModel projectViewModel;
@override
void initState() {
hmsApiAvailability = HmsApiAvailability();
latitude = widget.latitude;
longitude = widget.longitude;
checkIsHuawei();
if (latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
appMap = AppMap(
_kGooglePlex.toMap(),
onCameraMove: (camera) {
_updatePosition(camera);
},
onMapCreated: () {
currentPostion = LatLng(widget.latitude, widget.longitude);
latitude = widget.latitude;
longitude = widget.longitude;
_getUserLocation();
setState(() {});
},
onCameraIdle: () async {
List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude);
selectedPlace = placemarks[0];
print(selectedPlace);
},
);
if (Platform.isAndroid) checkIsHuawei();
WidgetsBinding.instance.addPostFrameCallback((_) {
latitude = projectViewModel.latitude;
longitude = projectViewModel.longitude;
appMap = AppMap(
_kGooglePlex.toMap(),
onCameraMove: (camera) {
_updatePosition(camera);
},
onMapCreated: () {
currentPostion = LatLng(projectViewModel.latitude, projectViewModel.longitude);
latitude = projectViewModel.latitude;
longitude = projectViewModel.longitude;
_getUserLocation();
setState(() {});
},
onCameraIdle: () async {
List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude);
selectedPlace = placemarks[0];
print(selectedPlace);
},
);
});
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(

@ -193,8 +193,8 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
// latitude: latitude,
// longitude: longitude,
),
),
).then((value) async {

@ -143,6 +143,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
reverse: true,
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID),

@ -54,7 +54,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
onModelReady: (model) {
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) {
addToSelectedProcedures(model);
});
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
@ -111,7 +115,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList.length > 0 && getTotalValue() != "0.00"
? () {
makePayment();
makePayment(model);
}
: null,
color: CustomColors.green,
@ -282,6 +286,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).insuranceCompany + ":",
@ -293,12 +298,15 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].companyName.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
Expanded(
child: Text(
model.ancillaryListsDetails[0].companyName.toString(),
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
),
],
@ -331,7 +339,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
),
),
Divider()
],
),
padding: EdgeInsets.only(top: 5.0, bottom: 10.0),
@ -348,35 +355,74 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
newMap.forEach((key, value) {
list.add(
Container(
padding: EdgeInsets.only(bottom: 8.0),
child: Text(key, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
);
list.add(
Container(
decoration: cardRadius(12),
margin: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Table(
columnWidths: {
0: FlexColumnWidth(1.0),
1: FlexColumnWidth(2.5),
2: FlexColumnWidth(1.5),
3: FlexColumnWidth(1.5),
4: FlexColumnWidth(1.5),
},
children: fullData(context, value),
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return AbsorbPointer(
absorbing: isProcedureDisabled(value[index]),
child: Container(
decoration: BoxDecoration(
color: getCardColor(value[index]),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Container(
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
decoration: BoxDecoration(
color: isProcedureDisabled(value[index]) ? Colors.grey[300] : Colors.white,
border: Border.all(color: isProcedureDisabled(value[index]) ? Colors.grey[300] : Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(bottom: 12.0),
child: Text(
getInsuranceText(value[index]),
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: getCardColor(value[index]), letterSpacing: -0.4, height: 16 / 10),
),
),
Table(
columnWidths: {
0: FlexColumnWidth(1.0),
1: FlexColumnWidth(2.5),
2: FlexColumnWidth(1.5),
3: FlexColumnWidth(1.5),
4: FlexColumnWidth(1.5),
},
children: fullData(context, value[index]),
),
],
),
),
),
],
),
),
),
);
},
separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: value.length),
);
});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: list,
@ -404,39 +450,38 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
);
for (int i = 0; i < value.length; i++) {
tableRow.add(
TableRow(children: [
Checkbox(
value: checkIfProcedureSelected(value[i]),
onChanged: (v) {
setState(() {
addSelectedProcedure(value[i]);
});
}),
Utils.tableColumnValue('${value[i].procedureName}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value[i].patientShare.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}',
isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}',
isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
]),
);
}
tableRow.add(
TableRow(children: [
Checkbox(
value: checkIfProcedureSelected(value),
onChanged: (v) {
setState(() {
addSelectedProcedure(value);
});
}),
Utils.tableColumnValue('${value.procedureName}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value.patientShare.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value.patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value.patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
]),
);
return tableRow;
}
makePayment() {
showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
selectedPaymentMethod = method;
print(selectedPaymentMethod);
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null);
}, patientShare: double.parse(getTotalValue()),
));
makePayment(AnciallryOrdersViewModel model) {
showDraggableDialog(
context,
PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
selectedPaymentMethod = method;
print(selectedPaymentMethod);
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan);
},
patientShare: double.parse(getTotalValue()),
));
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String selectedInstallmentPlan]) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.authenticatedUserObject.user.patientID);
@ -455,7 +500,12 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
browser,
false,
"3",
"");
"",
model.ancillaryListsDetails[0].appointmentDate,
model.ancillaryListsDetails[0].appointmentNo,
model.ancillaryListsDetails[0].clinicID,
model.ancillaryListsDetails[0].doctorID,
selectedInstallmentPlan);
}
onBrowserLoadStart(String url) {
@ -581,6 +631,60 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
}
}
addToSelectedProcedures(AnciallryOrdersViewModel model) {
if (model.ancillaryListsDetails.isNotEmpty) {
selectedProcList.clear();
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((element) {
if (!isProcedureDisabled(element)) {
selectedProcList.add(element);
}
});
setState(() {});
}
}
String getInsuranceText(value) {
String insuranceText = "";
if (!value.isApprovalRequired) {
insuranceText = "Cash";
} else {
if (value.isApprovalCreated && value.approvalNo != 0) {
insuranceText = "Approved";
} else if(value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
insuranceText = "Approval Rejected - Please visit receptionist";
} else {
insuranceText = "Sent For Approval";
}
}
return insuranceText;
}
Color getCardColor(value) {
Color color = Color(0xff);
if (!value.isApprovalRequired) {
color = Color(0xff2E303A);
} else {
if (value.isApprovalCreated && value.approvalNo != 0) {
color = Color(0xff359846);
} else if(value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
color = Color(0xffD02127);
} else {
color = Color(0xffCC9B14);
}
}
return color;
}
bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if ((ancillaryOrderProcDetailsList.isApprovalRequired && !ancillaryOrderProcDetailsList.isApprovalCreated) ||
(ancillaryOrderProcDetailsList.isApprovalCreated && ancillaryOrderProcDetailsList.approvalNo == 0) ||
(ancillaryOrderProcDetailsList.isApprovalRequired && ancillaryOrderProcDetailsList.isApprovalCreated && ancillaryOrderProcDetailsList.approvalNo == 0)) {
return true;
} else {
return false;
}
}
addSelectedProcedure(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if (!checkIfProcedureSelected(ancillaryOrderProcDetailsList)) {
selectedProcList.add(ancillaryOrderProcDetailsList);

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -467,7 +469,10 @@ class _BookSuccessState extends State<BookSuccess> {
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, context).then((res) {
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (isMoveHome) navigateToHome(context);
@ -544,6 +549,7 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID;
Navigator.push(
context,
@ -592,11 +598,18 @@ class _BookSuccessState extends State<BookSuccess> {
print(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
}
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -604,7 +617,9 @@ class _BookSuccessState extends State<BookSuccess> {
return;
}
});
// }
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -612,12 +627,13 @@ class _BookSuccessState extends State<BookSuccess> {
return;
}
});
// }
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
try {
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus(
@ -631,14 +647,24 @@ class _BookSuccessState extends State<BookSuccess> {
}
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 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") {
if (tamaraPaymentStatus.toLowerCase() == "approved") {
markAppointmentForTamara(appo);
addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
}
}).catchError((err) {
print(err);

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
@ -24,10 +25,13 @@ class Search extends StatefulWidget {
class _SearchState extends State<Search> with TickerProviderStateMixin {
TabController _tabController;
LocationUtils locationUtils;
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
super.initState();
}

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@ -242,9 +244,15 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print(url);
if (widget.selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
}
MyInAppBrowser.successURLS.forEach((element) {
@ -268,7 +276,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserExit Called!!!!");
try {
if (widget.selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "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 : "",
@ -282,14 +290,24 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
}
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 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") {
if (tamaraPaymentStatus.toLowerCase() == "approved") {
markAppointmentForTamara(appo);
addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
}
}).catchError((err) {
print(err);

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
@ -19,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import '../AvailableAppointmentsPage.dart';
@ -39,31 +42,35 @@ class PickupLocation extends StatefulWidget {
class _PickupLocationState extends State<PickupLocation> {
bool _isInsideHome = false;
HaveAppointment _haveAppointment = HaveAppointment.NO;
double _latitude;
double _longitude;
// double _latitude;
// double _longitude;
AppoitmentAllHistoryResultList myAppointment;
HospitalsModel _selectedHospital;
LocationDetails _result;
LocationUtils locationUtils;
ProjectViewModel projectViewModel;
@override
void initState() {
super.initState();
_getCurrentLocation();
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
setState(() {});
}
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
// _getCurrentLocation() async {
// await Geolocator.getLastKnownPosition().then((value) {
// _latitude = value.latitude;
// _longitude = value.longitude;
// }).catchError((e) {
// _longitude = 0;
// _latitude = 0;
// });
// }
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
@ -99,8 +106,8 @@ class _PickupLocationState extends State<PickupLocation> {
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude ?? 0,
longitude: _longitude ?? 0,
latitude: projectViewModel.latitude ?? 0,
longitude: projectViewModel.longitude ?? 0,
onPick: (value) {
setState(() {
_result = value;
@ -424,8 +431,8 @@ class _PickupLocationState extends State<PickupLocation> {
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
latitude: projectViewModel.latitude,
longitude: projectViewModel.longitude,
onPick: (value) {
setState(() {
_result = value;

@ -46,7 +46,7 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
physics: BouncingScrollPhysics(),
child: Column(
children: [
Container(
model.erPatientShareModel != null ? Container(
decoration: cardRadius(12),
margin: EdgeInsets.fromLTRB(12.0, 30.0, 12.0, 5.0),
child: Padding(
@ -108,7 +108,7 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
],
),
),
),
) : Container(),
mHeight(50.0),
Text(
TranslationBase.of(context).payOptions,
@ -132,10 +132,9 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
}, patientShare: model.erPatientShareModel.patientShareWithTax, isFromAdvancePayment: true,
))).then(
(value) {
//TODO Haroun call API here
print(value);
if (value != null) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
@ -203,8 +202,6 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
ER_createAdvancePayment(res, appo);

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'
import 'package:diplomaticquarterapp/core/service/er/er_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/hospital_location.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -27,10 +28,15 @@ class _NearestErState extends State<NearestEr> {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
bool isDataLoaded;
LocationUtils locationUtils;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getERList());
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) {
locationUtils.getCurrentLocation();
getERList();
});
super.initState();
}

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dial
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart';
@ -62,10 +63,13 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
AppMap appMap;
bool showCurrentLocation = false;
AppSharedPreferences sharedPref = AppSharedPreferences();
LocationUtils locationUtils;
@override
void initState() {
super.initState();
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
appMap = AppMap(
cameraPosition.toMap(),
@ -77,9 +81,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
setState(() {});
},
);
// addressStream = addressStreamController.stream;
// addressLoadingStream = addressLoadingStreamController.stream;
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
@ -186,8 +187,8 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
// latitude: latitude,
// longitude: longitude,
),
),
);

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
@ -892,37 +894,44 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
// Uri myUri = Uri.parse(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
print(tamaraPaymentStatus);
print(tamaraOrderID);
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
});
}
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
// }
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
// }
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "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);
@ -932,14 +941,25 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 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") {
if (tamaraPaymentStatus.toLowerCase() == "approved") {
markAppointmentForTamara(appo);
addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
}
}).catchError((err) {
print(err);
@ -1065,7 +1085,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, context).then((res) {
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory();
}).catchError((err) {
@ -1122,7 +1142,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, context).then((res) {
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);

@ -393,7 +393,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0,
padding: EdgeInsets.all(0.0),
width: 60,
child: Image.asset("assets/images/new/payment/tamara.png"),
child: SvgPicture.asset("assets/images/new/payment/tamara.svg"),
),
],
),

@ -454,8 +454,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).notClassified, 5),
RadioSelectionDialogModel(TranslationBase.of(context).complainAppo, 1),
RadioSelectionDialogModel(TranslationBase.of(context).complainWithoutAppo, 2),
RadioSelectionDialogModel(TranslationBase.of(context).question, 3),
RadioSelectionDialogModel(TranslationBase.of(context).complainWithoutAppo, 3),
RadioSelectionDialogModel(TranslationBase.of(context).question, 2),
RadioSelectionDialogModel(TranslationBase.of(context).compliment, 4),
RadioSelectionDialogModel(TranslationBase.of(context).suggestion, 6),
];

@ -324,9 +324,15 @@ class _clinic_listState extends State<ClinicList> {
print(url);
if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
}
MyInAppBrowser.successURLS.forEach((element) {
@ -350,7 +356,7 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserExit Called!!!!");
try {
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus(
@ -371,7 +377,7 @@ class _clinic_listState extends State<ClinicList> {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") {
if (tamaraPaymentStatus.toLowerCase() == "approved") {
addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo));
} else {
AppToast.showErrorToast(message: res['Response_Message']);

@ -203,7 +203,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
keyboardType: TextInputType.text,
controller: _controller,
onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle(
@ -283,9 +283,13 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false;
if(res['Covid19_Certificate_GetPassportList'].length != 0) {
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false;
}
} else {
passportNumber.text = "";
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -45,6 +46,8 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
AddressInfo _selectedAddress;
int _selectedAddressIndex = -1;
Completer<GoogleMapController> _controller = Completer();
ProjectViewModel projectViewModel;
LocationUtils locationUtils;
CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(24.665011045779107, 46.73502189439707),
@ -57,56 +60,57 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
@override
void initState() {
super.initState();
_getCurrentLocation();
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
}
_getCurrentLocation() async {
if (await PermissionService.isLocationEnabled()) {
await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
});
} else {
await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
}
}
}
// _getCurrentLocation() async {
// if (await PermissionService.isLocationEnabled()) {
// await Geolocator.getLastKnownPosition().then((value) {
// latitude = value.latitude;
// longitude = value.longitude;
// _kGooglePlex = CameraPosition(
// target: LatLng(latitude, longitude),
// zoom: 14.4746,
// );
// }).catchError((e) {
// latitude = 24.665011045779107;
// longitude = 46.73502189439707;
// });
// } else {
// if (Platform.isAndroid) {
// Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).locationPermissionDialog, () {
// Geolocator.getLastKnownPosition().then((value) {
// latitude = value.latitude;
// latitude = value.longitude;
// _kGooglePlex = CameraPosition(
// target: LatLng(latitude, longitude),
// zoom: 14.4746,
// );
// }).catchError((e) {
// latitude = 24.665011045779107;
// latitude = 46.73502189439707;
// });
// });
// } else {
// await Geolocator.getLastKnownPosition().then((value) {
// latitude = value.latitude;
// latitude = value.longitude;
// _kGooglePlex = CameraPosition(
// target: LatLng(latitude, longitude),
// zoom: 14.4746,
// );
// }).catchError((e) {
// latitude = 24.665011045779107;
// latitude = 46.73502189439707;
// });
// }
// }
// }
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return BaseView<PrescriptionDeliveryViewModel>(
onModelReady: (model) => model.getCustomerInfo(),
builder: (_, model, w) => AppScaffold(
@ -169,8 +173,8 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
// latitude: latitude,
// longitude: longitude,
),
),
).then((value) {

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -37,10 +38,13 @@ class PrescriptionDetailsPage extends StatefulWidget {
class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
bool hasReminder = false;
LocationUtils locationUtils;
@override
void initState() {
checkIfHasReminder();
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
super.initState();
}
@ -247,15 +251,17 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) {
if (element.title.contains(widget.prescriptionReport.itemDescriptionN))
setState(() {
hasReminder = true;
});
if(calendarUtils.calendars != null) {
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) {
if (element.title.contains(widget.prescriptionReport.itemDescriptionN))
setState(() {
hasReminder = true;
});
});
});
});
}
}
cancelReminders() async {

@ -388,9 +388,9 @@ class PrescriptionItemsPage extends StatelessWidget {
child: DefaultButton(
TranslationBase.of(context).resendOrder,
() {
if (model.isMedDeliveryAllowed == false) {
AppToast.showErrorToast(message: TranslationBase.of(context).prescriptionDeliveryError);
} else {
// if (model.isMedDeliveryAllowed == false) {
// AppToast.showErrorToast(message: TranslationBase.of(context).prescriptionDeliveryError);
// } else {
Navigator.push(
context,
FadePage(
@ -401,7 +401,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
),
);
}
// }
},
color: model.isMedDeliveryAllowed == false ? Color(0xff575757) : Color(0xff359846),
disabledColor: Color(0xff575757),

@ -707,7 +707,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, BuildContext context) async {
Future<Map> insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -728,6 +728,7 @@ class DoctorsListService extends BaseService {
request = {
"AppointmentNo": appoNo,
"AppointmentDate": appoDate,
"ClientRequestID": clientRequestID,
"ClinicID": clinicID,
"ProjectID": projectID,
"ServiceID": serviceID,
@ -749,6 +750,7 @@ class DoctorsListService extends BaseService {
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType,
"VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN),
"IsVoip": Platform.isIOS ? true : false
};
dynamic localRes;

@ -224,7 +224,8 @@ class LiveCareService extends BaseService {
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0
"Gender": authUser.gender != null ? authUser.gender : 0,
"IsVoip": Platform.isIOS ? true : false
};
dynamic localRes;

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -8,7 +9,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_location/location/fused_location_provider_client.dart';
import 'package:huawei_location/location/location.dart';
import 'package:huawei_location/location/location_callback.dart';
@ -16,6 +16,7 @@ import 'package:huawei_location/location/location_request.dart';
import 'package:huawei_location/location/location_settings_request.dart';
import 'package:huawei_location/permission/permission_handler.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
class LocationUtils {
AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -123,7 +124,7 @@ class LocationUtils {
confirmMessage: TranslationBase.of(context).locationDialogMessage,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings()},
okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings(), Navigator.of(context).pop()},
cancelFunction: () => {});
return dialog.showAlertDialog(context);
}
@ -131,6 +132,8 @@ class LocationUtils {
void setLocation(Position position) {
this.sharedPref.setDouble(USER_LAT, position != null ? position.latitude : 0.0);
this.sharedPref.setDouble(USER_LONG, position != null ? position.longitude : 0.0);
ProjectViewModel projectViewModel = Provider.of(context, listen: false);
projectViewModel.setLatitudeLongitude(position.latitude, position.longitude);
}
void setZeroLocation() {

@ -16,6 +16,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:firebase_messaging/firebase_messaging.dart' as fir;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:flutter_ios_voip_kit/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart';
@ -223,7 +224,7 @@ class PushNotificationHandler {
// if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) {
if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) async {
if(value != 0) {
if (value != 0) {
final fcmToken = await FirebaseMessaging.instance.getToken();
if (fcmToken != null) onToken(fcmToken);
}
@ -239,8 +240,56 @@ class PushNotificationHandler {
// if (Platform.isAndroid) {
// if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) {
// } else {
// 'Android GMS or iOS' (Handle Firebase Messaging Streams
FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async {
print("Firebase getInitialMessage!!!");
subscribeFCMTopic();
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
if (message != null) newMessage(message);
});
else if (message != null) newMessage(message);
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print("Firebase onMessage!!!");
// Utils.showPermissionConsentDialog(context, "onMessage", (){});
// newMessage(message);
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
newMessage(message);
});
else
newMessage(message);
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
print("Firebase onMessageOpenedApp!!!");
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
newMessage(message);
});
else
newMessage(message);
});
FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) {
print("Push Notification onTokenRefresh: " + fcm_token);
onToken(fcm_token);
});
FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) {
print("Push Notification getToken: " + token);
onToken(token);
});
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) async {
if(value == 0) {
if (value == 0) {
h_push.Push.enableLogger();
final result = await h_push.Push.setAutoInitEnabled(true);
@ -259,55 +308,10 @@ class PushNotificationHandler {
h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler);
}
}).catchError((err) {
print(err);
});
// } else {
// 'Android GMS or iOS' (Handle Firebase Messaging Streams
FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async {
print("Firebase getInitialMessage!!!");
subscribeFCMTopic();
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
if (message != null) newMessage(message);
});
else if (message != null) newMessage(message);
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print("Firebase onMessage!!!");
// Utils.showPermissionConsentDialog(context, "onMessage", (){});
// newMessage(message);
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
newMessage(message);
});
else
newMessage(message);
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
print("Firebase onMessageOpenedApp!!!");
if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) {
newMessage(message);
});
else
newMessage(message);
});
FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) {
print("Push Notification onTokenRefresh: " + fcm_token);
onToken(fcm_token);
});
FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) {
print("Push Notification getToken: " + token);
onToken(token);
});
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
// }
}
}
subscribeFCMTopic() async {

@ -756,7 +756,7 @@ class Utils {
children: [
SizedBox(height: 12),
Text(
isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text,
isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),

@ -4,6 +4,7 @@ import 'package:flutter_svg/svg.dart';
extension WithContainer on Widget {
Widget get insideContainer => Container(color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this);
Widget get expand => Expanded(child: this);
Widget get insideContainerTableRow => Container(color: Colors.white, padding: EdgeInsets.only(right: 5, left: 5), child: this);
}
class DefaultButton extends StatelessWidget {

@ -183,27 +183,29 @@ class LabResultWidget extends StatelessWidget {
children: [
Padding(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0),
child: Utils.tableColumnValue(labResultList[i].description ?? "", isLast: true),
child: Utils.tableColumnValue(labResultList[i].description ?? "", isLast: true, mProjectViewModel: projectViewModel),
),
Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false),
!checkIfCovidLab(patientLabResultList) ? InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
!checkIfCovidLab(patientLabResultList)
? InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
),
),
);
},
child: Padding(
padding: EdgeInsets.only(left: !projectViewModel.isArabic ? 0 : 12, right: !projectViewModel.isArabic ? 12 : 0),
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
),
),
);
},
child: Padding(
padding: EdgeInsets.only(left: !projectViewModel.isArabic ? 0 : 12, right: !projectViewModel.isArabic ? 12 : 0),
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
),
) : Container(),
)
: Container(),
],
),
);

@ -54,9 +54,9 @@ class MyInAppBrowser extends InAppBrowser {
static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
static List<String> successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails', 'redirectToApplePay'];
static List<String> successURLS = ['success?', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?'];
final Function onExitCallback;
final Function onLoadStartCallback;

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart';
@ -49,7 +51,7 @@ class _PickupLocationFromMapState extends State<PickupLocationFromMap> {
@override
void initState() {
hmsApiAvailability = HmsApiAvailability();
checkIsHuawei();
if(Platform.isAndroid) checkIsHuawei();
appMap = AppMap(
kGooglePlex.toMap(),
@ -167,7 +169,7 @@ class _PickupLocationFromMapState extends State<PickupLocationFromMap> {
),
);
},
initialPosition: LatLng(widget.latitude, widget.longitude),
initialPosition: LatLng(projectViewModel.latitude, projectViewModel.longitude),
useCurrentLocation: true,
),
);

@ -1,7 +1,7 @@
name: diplomaticquarterapp
description: A new Flutter application.
version: 4.4.996+4040996
version: 4.4.998+4040998
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save