Updates, fixes & release VersionID 9.1

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 21cf9da900
commit dfa88b7de7

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

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

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

@ -18,13 +18,14 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
await _pharmacyModuleService.generatePharmacyToken().then((value) async { await _pharmacyModuleService.generatePharmacyToken().then((value) async {
// await _customerAddressesService.getCustomerInfo(); // await _customerAddressesService.getCustomerInfo();
// await _customerAddressesService.getCustomerInfo(); // await _customerAddressesService.getCustomerInfo();
await _pharmacyModuleService.createUser(); await _pharmacyModuleService.createUser().then((value) async {
await getCustomerAddresses();
});
}); });
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else {} } else {}
await getCustomerAddresses();
} }
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID, int projectID}) async { 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; bool isLogin = false;
int laserSelectionDuration; int laserSelectionDuration;
double _latitude;
double _longitude;
double get latitude => _latitude;
double get longitude => _longitude;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale; 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 { Future loadSharedPrefLanguage() async {
currentLanguage = currentLanguage =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');

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

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

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

@ -143,6 +143,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
ListView.separated( ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
reverse: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID), 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) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>( 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( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
@ -111,7 +115,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
TranslationBase.of(context).payNow.toUpperCase(), TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList.length > 0 && getTotalValue() != "0.00" selectedProcList.length > 0 && getTotalValue() != "0.00"
? () { ? () {
makePayment(); makePayment(model);
} }
: null, : null,
color: CustomColors.green, color: CustomColors.green,
@ -282,6 +286,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).insuranceCompany + ":", TranslationBase.of(context).insuranceCompany + ":",
@ -293,12 +298,15 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
), ),
mWidth(3), mWidth(3),
Text( Expanded(
model.ancillaryListsDetails[0].companyName.toString(), child: Text(
style: TextStyle( model.ancillaryListsDetails[0].companyName.toString(),
fontWeight: FontWeight.w600, overflow: TextOverflow.clip,
fontSize: 12, style: TextStyle(
letterSpacing: -0.48, 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), padding: EdgeInsets.only(top: 5.0, bottom: 10.0),
@ -348,35 +355,74 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
newMap.forEach((key, value) { newMap.forEach((key, value) {
list.add( list.add(
Container( Container(
padding: EdgeInsets.only(bottom: 8.0),
child: Text(key, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)), child: Text(key, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)),
), ),
); );
list.add( list.add(
Container( ListView.separated(
decoration: cardRadius(12), shrinkWrap: true,
margin: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 16), physics: NeverScrollableScrollPhysics(),
child: Padding( itemBuilder: (context, index) {
padding: const EdgeInsets.all(12.0), return AbsorbPointer(
child: Column( absorbing: isProcedureDisabled(value[index]),
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ decoration: BoxDecoration(
Table( color: getCardColor(value[index]),
columnWidths: { borderRadius: BorderRadius.all(
0: FlexColumnWidth(1.0), Radius.circular(10.0),
1: FlexColumnWidth(2.5), ),
2: FlexColumnWidth(1.5), boxShadow: [
3: FlexColumnWidth(1.5), BoxShadow(
4: FlexColumnWidth(1.5), color: Color(0xff000000).withOpacity(.05),
}, blurRadius: 27,
children: fullData(context, value), 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( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: list, children: list,
@ -404,39 +450,38 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
); );
for (int i = 0; i < value.length; i++) { tableRow.add(
tableRow.add( TableRow(children: [
TableRow(children: [ Checkbox(
Checkbox( value: checkIfProcedureSelected(value),
value: checkIfProcedureSelected(value[i]), onChanged: (v) {
onChanged: (v) { setState(() {
setState(() { addSelectedProcedure(value);
addSelectedProcedure(value[i]); });
}); }),
}), Utils.tableColumnValue('${value.procedureName}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${value[i].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[i].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[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', Utils.tableColumnValue('${value.patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
isLast: true, isCapitable: false, mProjectViewModel: projectViewModel), ]),
Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', );
isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
]),
);
}
return tableRow; return tableRow;
} }
makePayment() { makePayment(AnciallryOrdersViewModel model) {
showDraggableDialog(context, PaymentMethod( showDraggableDialog(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) { context,
selectedPaymentMethod = method; PaymentMethod(
print(selectedPaymentMethod); onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null); selectedPaymentMethod = method;
}, patientShare: double.parse(getTotalValue()), 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); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.authenticatedUserObject.user.patientID); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.authenticatedUserObject.user.patientID);
@ -455,7 +500,12 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
browser, browser,
false, false,
"3", "3",
""); "",
model.ancillaryListsDetails[0].appointmentDate,
model.ancillaryListsDetails[0].appointmentNo,
model.ancillaryListsDetails[0].clinicID,
model.ancillaryListsDetails[0].doctorID,
selectedInstallmentPlan);
} }
onBrowserLoadStart(String url) { 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) { addSelectedProcedure(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if (!checkIfProcedureSelected(ancillaryOrderProcDetailsList)) { if (!checkIfProcedureSelected(ancillaryOrderProcDetailsList)) {
selectedProcList.add(ancillaryOrderProcDetailsList); selectedProcList.add(ancillaryOrderProcDetailsList);

@ -1,3 +1,5 @@
import 'dart:io';
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/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -467,7 +469,10 @@ class _BookSuccessState extends State<BookSuccess> {
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); 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); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (isMoveHome) navigateToHome(context); if (isMoveHome) navigateToHome(context);
@ -544,6 +549,7 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectName = widget.patientShareResponse.projectName; appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID;
Navigator.push( Navigator.push(
context, context,
@ -592,11 +598,18 @@ class _BookSuccessState extends State<BookSuccess> {
print(url); print(url);
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url); if (Platform.isAndroid) {
tamaraPaymentStatus = uri.queryParameters['paymentStatus']; Uri uri = new Uri.dataFromString(url);
tamaraOrderID = uri.queryParameters['orderId']; 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) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -604,7 +617,9 @@ class _BookSuccessState extends State<BookSuccess> {
return; return;
} }
}); });
// }
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -612,12 +627,13 @@ class _BookSuccessState extends State<BookSuccess> {
return; return;
} }
}); });
// }
} }
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
try { try {
if (selectedPaymentMethod == "TAMARA") { 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); updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
} else { } else {
updateTamaraRequestStatus( 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) { updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
try { try {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") { if (tamaraPaymentStatus.toLowerCase() == "approved") {
markAppointmentForTamara(appo); markAppointmentForTamara(appo);
addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
} }
}).catchError((err) { }).catchError((err) {
print(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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.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/uitl/translations_delegate_base.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';
@ -24,10 +25,13 @@ class Search extends StatefulWidget {
class _SearchState extends State<Search> with TickerProviderStateMixin { class _SearchState extends State<Search> with TickerProviderStateMixin {
TabController _tabController; TabController _tabController;
LocationUtils locationUtils;
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
super.initState(); super.initState();
} }

@ -1,3 +1,5 @@
import 'dart:io';
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';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@ -242,9 +244,15 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print(url); print(url);
if (widget.selectedPaymentMethod == "TAMARA") { if (widget.selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url); if (Platform.isAndroid) {
tamaraPaymentStatus = uri.queryParameters['paymentStatus']; Uri uri = new Uri.dataFromString(url);
tamaraOrderID = uri.queryParameters['orderId']; 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) { MyInAppBrowser.successURLS.forEach((element) {
@ -268,7 +276,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (widget.selectedPaymentMethod == "TAMARA") { 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); updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
} else { } else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", 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) { updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
try { try {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus == "approved") { if (tamaraPaymentStatus.toLowerCase() == "approved") {
markAppointmentForTamara(appo); markAppointmentForTamara(appo);
addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
} }
}).catchError((err) { }).catchError((err) {
print(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/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.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/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/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart'; import 'package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.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/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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import '../AvailableAppointmentsPage.dart'; import '../AvailableAppointmentsPage.dart';
@ -39,31 +42,35 @@ class PickupLocation extends StatefulWidget {
class _PickupLocationState extends State<PickupLocation> { class _PickupLocationState extends State<PickupLocation> {
bool _isInsideHome = false; bool _isInsideHome = false;
HaveAppointment _haveAppointment = HaveAppointment.NO; HaveAppointment _haveAppointment = HaveAppointment.NO;
double _latitude; // double _latitude;
double _longitude; // double _longitude;
AppoitmentAllHistoryResultList myAppointment; AppoitmentAllHistoryResultList myAppointment;
HospitalsModel _selectedHospital; HospitalsModel _selectedHospital;
LocationDetails _result; LocationDetails _result;
LocationUtils locationUtils;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_getCurrentLocation(); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
setState(() {}); setState(() {});
} }
_getCurrentLocation() async { // _getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) { // await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude; // _latitude = value.latitude;
_longitude = value.longitude; // _longitude = value.longitude;
}).catchError((e) { // }).catchError((e) {
_longitude = 0; // _longitude = 0;
_latitude = 0; // _latitude = 0;
}); // });
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isShowDecPage: false, isShowDecPage: false,
@ -99,8 +106,8 @@ class _PickupLocationState extends State<PickupLocation> {
context, context,
FadePage( FadePage(
page: PickupLocationFromMap( page: PickupLocationFromMap(
latitude: _latitude ?? 0, latitude: projectViewModel.latitude ?? 0,
longitude: _longitude ?? 0, longitude: projectViewModel.longitude ?? 0,
onPick: (value) { onPick: (value) {
setState(() { setState(() {
_result = value; _result = value;
@ -424,8 +431,8 @@ class _PickupLocationState extends State<PickupLocation> {
context, context,
FadePage( FadePage(
page: PickupLocationFromMap( page: PickupLocationFromMap(
latitude: _latitude, latitude: projectViewModel.latitude,
longitude: _longitude, longitude: projectViewModel.longitude,
onPick: (value) { onPick: (value) {
setState(() { setState(() {
_result = value; _result = value;

@ -46,7 +46,7 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
children: [ children: [
Container( model.erPatientShareModel != null ? Container(
decoration: cardRadius(12), decoration: cardRadius(12),
margin: EdgeInsets.fromLTRB(12.0, 30.0, 12.0, 5.0), margin: EdgeInsets.fromLTRB(12.0, 30.0, 12.0, 5.0),
child: Padding( child: Padding(
@ -108,7 +108,7 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
], ],
), ),
), ),
), ) : Container(),
mHeight(50.0), mHeight(50.0),
Text( Text(
TranslationBase.of(context).payOptions, TranslationBase.of(context).payOptions,
@ -132,10 +132,9 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
Navigator.push(context, FadePage(page: PaymentMethod( Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, }, patientShare: model.erPatientShareModel.patientShareWithTax, isFromAdvancePayment: true,
))).then( ))).then(
(value) { (value) {
//TODO Haroun call API here
print(value); print(value);
if (value != null) { if (value != null) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
@ -203,8 +202,6 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.checkPaymentStatus(transID, AppGlobal.context).then((res) { service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
ER_createAdvancePayment(res, appo); 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/core/service/er/er_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/hospital_location.dart'; import 'package:diplomaticquarterapp/widgets/hospital_location.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -27,10 +28,15 @@ class _NearestErState extends State<NearestEr> {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List(); List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
bool isDataLoaded; bool isDataLoaded;
LocationUtils locationUtils;
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getERList()); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) {
locationUtils.getCurrentLocation();
getERList();
});
super.initState(); 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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart'; import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart';
@ -62,10 +63,13 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
AppMap appMap; AppMap appMap;
bool showCurrentLocation = false; bool showCurrentLocation = false;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
LocationUtils locationUtils;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
appMap = AppMap( appMap = AppMap(
cameraPosition.toMap(), cameraPosition.toMap(),
@ -77,9 +81,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
setState(() {}); setState(() {});
}, },
); );
// addressStream = addressStreamController.stream;
// addressLoadingStream = addressLoadingStreamController.stream;
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async { setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
@ -186,8 +187,8 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
context, context,
FadePage( FadePage(
page: LocationPage( page: LocationPage(
latitude: latitude, // latitude: latitude,
longitude: longitude, // longitude: longitude,
), ),
), ),
); );

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

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

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

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

@ -203,7 +203,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.text,
controller: _controller, controller: _controller,
onChanged: (value) => {_onPassportTextChanged(value)}, onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle( style: TextStyle(
@ -283,9 +283,13 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
service.getCovidPassportNumber().then((res) { service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; if(res['Covid19_Certificate_GetPassportList'].length != 0) {
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
_isButtonDisabled = false; if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false;
}
} else {
passportNumber.text = "";
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); 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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -45,6 +46,8 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
int _selectedAddressIndex = -1; int _selectedAddressIndex = -1;
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
ProjectViewModel projectViewModel;
LocationUtils locationUtils;
CameraPosition _kGooglePlex = CameraPosition( CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(24.665011045779107, 46.73502189439707), target: LatLng(24.665011045779107, 46.73502189439707),
@ -57,56 +60,57 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_getCurrentLocation(); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
} }
_getCurrentLocation() async { // _getCurrentLocation() async {
if (await PermissionService.isLocationEnabled()) { // if (await PermissionService.isLocationEnabled()) {
await Geolocator.getLastKnownPosition().then((value) { // await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; // latitude = value.latitude;
latitude = value.longitude; // longitude = value.longitude;
_kGooglePlex = CameraPosition( // _kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude), // target: LatLng(latitude, longitude),
zoom: 14.4746, // zoom: 14.4746,
); // );
}).catchError((e) { // }).catchError((e) {
latitude = 24.665011045779107; // latitude = 24.665011045779107;
latitude = 46.73502189439707; // longitude = 46.73502189439707;
}); // });
} else { // } else {
if (Platform.isAndroid) { // if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).locationPermissionDialog, () { // Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) { // Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; // latitude = value.latitude;
latitude = value.longitude; // latitude = value.longitude;
_kGooglePlex = CameraPosition( // _kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude), // target: LatLng(latitude, longitude),
zoom: 14.4746, // zoom: 14.4746,
); // );
}).catchError((e) { // }).catchError((e) {
latitude = 24.665011045779107; // latitude = 24.665011045779107;
latitude = 46.73502189439707; // latitude = 46.73502189439707;
}); // });
}); // });
} else { // } else {
await Geolocator.getLastKnownPosition().then((value) { // await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; // latitude = value.latitude;
latitude = value.longitude; // latitude = value.longitude;
_kGooglePlex = CameraPosition( // _kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude), // target: LatLng(latitude, longitude),
zoom: 14.4746, // zoom: 14.4746,
); // );
}).catchError((e) { // }).catchError((e) {
latitude = 24.665011045779107; // latitude = 24.665011045779107;
latitude = 46.73502189439707; // latitude = 46.73502189439707;
}); // });
} // }
} // }
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<PrescriptionDeliveryViewModel>( return BaseView<PrescriptionDeliveryViewModel>(
onModelReady: (model) => model.getCustomerInfo(), onModelReady: (model) => model.getCustomerInfo(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -169,8 +173,8 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
context, context,
FadePage( FadePage(
page: LocationPage( page: LocationPage(
latitude: latitude, // latitude: latitude,
longitude: longitude, // longitude: longitude,
), ),
), ),
).then((value) { ).then((value) {

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

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

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

@ -224,7 +224,8 @@ class LiveCareService extends BaseService {
"DeviceType": Platform.isIOS ? 'iOS' : 'Android', "DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 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; dynamic localRes;

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
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/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -8,7 +9,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.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/fused_location_provider_client.dart';
import 'package:huawei_location/location/location.dart'; import 'package:huawei_location/location/location.dart';
import 'package:huawei_location/location/location_callback.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/location/location_settings_request.dart';
import 'package:huawei_location/permission/permission_handler.dart'; import 'package:huawei_location/permission/permission_handler.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
class LocationUtils { class LocationUtils {
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -123,7 +124,7 @@ class LocationUtils {
confirmMessage: TranslationBase.of(context).locationDialogMessage, confirmMessage: TranslationBase.of(context).locationDialogMessage,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, 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: () => {}); cancelFunction: () => {});
return dialog.showAlertDialog(context); return dialog.showAlertDialog(context);
} }
@ -131,6 +132,8 @@ class LocationUtils {
void setLocation(Position position) { void setLocation(Position position) {
this.sharedPref.setDouble(USER_LAT, position != null ? position.latitude : 0.0); this.sharedPref.setDouble(USER_LAT, position != null ? position.latitude : 0.0);
this.sharedPref.setDouble(USER_LONG, position != null ? position.longitude : 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() { void setZeroLocation() {

@ -16,6 +16,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:firebase_messaging/firebase_messaging.dart' as fir; import 'package:firebase_messaging/firebase_messaging.dart' as fir;
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.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/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.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 FlutterHmsGmsAvailability.isHmsAvailable)) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) async { await hmsApiAvailability.isHMSAvailable().then((value) async {
if(value != 0) { if (value != 0) {
final fcmToken = await FirebaseMessaging.instance.getToken(); final fcmToken = await FirebaseMessaging.instance.getToken();
if (fcmToken != null) onToken(fcmToken); if (fcmToken != null) onToken(fcmToken);
} }
@ -239,8 +240,56 @@ class PushNotificationHandler {
// if (Platform.isAndroid) { // if (Platform.isAndroid) {
// if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) { // 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 { await hmsApiAvailability.isHMSAvailable().then((value) async {
if(value == 0) { if (value == 0) {
h_push.Push.enableLogger(); h_push.Push.enableLogger();
final result = await h_push.Push.setAutoInitEnabled(true); final result = await h_push.Push.setAutoInitEnabled(true);
@ -259,55 +308,10 @@ class PushNotificationHandler {
h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); 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 { subscribeFCMTopic() async {

@ -756,7 +756,7 @@ class Utils {
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
Text( 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), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),

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

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

@ -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_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; 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 onExitCallback;
final Function onLoadStartCallback; final Function onLoadStartCallback;

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

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

Loading…
Cancel
Save