Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into Fatima-New-Design

merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
commit 216cc4a7e3

@ -68,7 +68,9 @@ const GET_DOCTOR_RATING_DETAILS =
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; // const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = const GET_PRESCRIPTION_REPORT =
@ -570,7 +572,10 @@ const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview"; const GET_MOST_VIEWED_PRODUCTS = "mostview";
const GET_NEW_PRODUCTS = "newproducts"; const GET_NEW_PRODUCTS = "newproducts";

@ -1,11 +1,11 @@
import 'PointsAmountPerday.dart'; import 'PointsAmountPerday.dart';
class PointsAmountPerMonth { class PointsAmountPerMonth {
double amountPerMonth; dynamic amountPerMonth;
String month; dynamic month;
int monthNumber; int monthNumber;
List<PointsAmountPerday> pointsAmountPerday; List<PointsAmountPerday> pointsAmountPerday;
double pointsPerMonth; dynamic pointsPerMonth;
PointsAmountPerMonth( PointsAmountPerMonth(
{this.amountPerMonth, {this.amountPerMonth,

@ -31,6 +31,7 @@ class Orders {
String orderStatusn; String orderStatusn;
bool canCancel; bool canCancel;
bool canRefund; bool canRefund;
String orderGuid;
dynamic customerId; dynamic customerId;
dynamic orderSubtotalExclTax; dynamic orderSubtotalExclTax;
dynamic orderShippingExclTax; dynamic orderShippingExclTax;
@ -47,6 +48,7 @@ class Orders {
this.orderStatusn, this.orderStatusn,
this.canCancel, this.canCancel,
this.canRefund, this.canRefund,
this.orderGuid,
this.customerId, this.customerId,
this.orderShippingExclTax, this.orderShippingExclTax,
this.orderSubtotalExclTax, this.orderSubtotalExclTax,
@ -63,6 +65,7 @@ class Orders {
orderStatusn = json['order_statusn']; orderStatusn = json['order_statusn'];
canCancel = json['can_cancel']; canCancel = json['can_cancel'];
canRefund = json['can_refund']; canRefund = json['can_refund'];
orderGuid = json['order_guid'];
customerId = json['customer_id']; customerId = json['customer_id'];
orderSubtotalExclTax= json["order_subtotal_excl_tax"]; orderSubtotalExclTax= json["order_subtotal_excl_tax"];
orderShippingExclTax= json["order_shipping_excl_tax"]; orderShippingExclTax= json["order_shipping_excl_tax"];

@ -49,9 +49,9 @@ class OrderModelViewModel extends BaseViewModel {
} }
} }
Future<OrderDetailModel> getOrderDetails(OrderId) async { Future<OrderDetailModel> getOrderDetails(OrderId, orderGUID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(OrderId); await _orderDetailsService.getOrderDetails(OrderId, orderGUID);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {
error = _orderDetailsService.error; error = _orderDetailsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -201,9 +201,9 @@ class _BookConfirmState extends State<BookConfirm> {
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () async { onPressed: () async {
if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor);
} }
}, },
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
@ -249,7 +249,7 @@ class _BookConfirmState extends State<BookConfirm> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () async { Future.delayed(new Duration(milliseconds: 1500), () async {
if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
@ -376,7 +376,6 @@ class _BookConfirmState extends State<BookConfirm> {
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
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/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
@ -14,6 +15,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAl
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart';
@ -57,6 +59,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(context);
var size = MediaQuery.of(context).size; var size = MediaQuery.of(context).size;
final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
@ -72,7 +75,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
onTap: shouldEnable onTap: shouldEnable
? null ? null
: () { : () {
_handleButtonClicks(appoButtonsList[index]); _handleButtonClicks(appoButtonsList[index], model);
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: appoButtonsList[index].title, title: appoButtonsList[index].title,
@ -88,7 +91,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
); );
} }
_handleButtonClicks(AppoDetailsButton) { _handleButtonClicks(AppoDetailsButton, ToDoCountProviderModel model) {
switch (AppoDetailsButton.caller) { switch (AppoDetailsButton.caller) {
case "openReschedule": case "openReschedule":
widget.tabController.animateTo((widget.tabController.index + 1) % 2); widget.tabController.animateTo((widget.tabController.index + 1) % 2);
@ -113,7 +116,8 @@ class _AppointmentActionsState extends State<AppointmentActions> {
); );
break; break;
case "goToTodoList": case "goToTodoList":
Navigator.of(context).pop(); // Navigator.of(context).pop();
navigateToToDoPage(context, model);
break; break;
case "askDoc": case "askDoc":
askYourDoc(); askYourDoc();
@ -556,6 +560,18 @@ class _AppointmentActionsState extends State<AppointmentActions> {
))); )));
} }
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
} else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
}
}
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -65,12 +65,12 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
unselectedLabelColor: Color(0xff575757), unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 16, fontSize: 15,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontSize: 16, fontSize: 15,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),

@ -137,8 +137,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
}); });
generateWeekData(); generateWeekData();
setState(() { setState(() {
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength; if (avgWeeklyStepsValue != 0) {
weeklyStatsAvgValue = weeklyStatsAvgValue / 1000; weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
weeklyStatsAvgValue = weeklyStatsAvgValue / 1000;
}
isWeeklyDataLoaded = true; isWeeklyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -165,8 +167,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
}); });
generateMonthData(); generateMonthData();
setState(() { setState(() {
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength; if (avgMonthlyStepsValue != 0) {
monthlyStatsAvgValue = monthlyStatsAvgValue / 1000; monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength;
monthlyStatsAvgValue = monthlyStatsAvgValue / 1000;
}
isMonthlyDataLoaded = true; isMonthlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -193,8 +197,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
}); });
generateYearData(); generateYearData();
setState(() { setState(() {
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength; if (avgYearlyStepsValue != 0) {
yearlyStatsAvgValue = yearlyStatsAvgValue / 1000; yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
yearlyStatsAvgValue = yearlyStatsAvgValue / 1000;
}
isYearlyDataLoaded = true; isYearlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -457,16 +463,16 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
children: <Widget>[ children: <Widget>[
yearlyStepsList.isEmpty yearlyStepsList.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Text(TranslationBase.of(context).noDataAvailable), child: Text(TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Table(
columnWidths: { columnWidths: {
0: FlexColumnWidth(2.5), 0: FlexColumnWidth(2.5),
}, },
children: fullData(context), children: fullData(context),
), ),
], ],
), ),
) )
@ -549,7 +555,7 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
), ),
); );
yearlyStepsList.forEach( yearlyStepsList.forEach(
(step) { (step) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
@ -559,7 +565,8 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
)} ', )} ',
isCapitable: false, isCapitable: false,
mProjectViewModel: projectViewModel), mProjectViewModel: projectViewModel),
Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_ , isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_,
isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );
@ -567,5 +574,4 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
); );
return tableRow; return tableRow;
} }
} }

@ -171,7 +171,9 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
}); });
generateMonthData(); generateMonthData();
setState(() { setState(() {
monthlyStatsAvgValue = avgMonthlyHearRateValue ~/ monthlyDataLength; if (avgMonthlyHearRateValue != 0) {
monthlyStatsAvgValue = avgMonthlyHearRateValue ~/ monthlyDataLength;
}
isMonthlyDataLoaded = true; isMonthlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -198,7 +200,9 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
}); });
generateYearData(); generateYearData();
setState(() { setState(() {
yearlyStatsAvgValue = avgYearlyHearRateValue ~/ yearlyDataLength; if (avgYearlyHearRateValue != 0) {
yearlyStatsAvgValue = avgYearlyHearRateValue ~/ yearlyDataLength;
}
isYearlyDataLoaded = true; isYearlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {

@ -136,7 +136,9 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
}); });
generateWeekData(); generateWeekData();
setState(() { setState(() {
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength; if (avgWeeklyStepsValue != 0) {
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
}
isWeeklyDataLoaded = true; isWeeklyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -163,7 +165,9 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
}); });
generateMonthData(); generateMonthData();
setState(() { setState(() {
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength; if (avgMonthlyStepsValue != 0) {
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength;
}
isMonthlyDataLoaded = true; isMonthlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -190,7 +194,9 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
}); });
generateYearData(); generateYearData();
setState(() { setState(() {
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength; if (avgYearlyStepsValue != 0) {
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
}
isYearlyDataLoaded = true; isYearlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart'; import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
@ -8,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:fit_kit/fit_kit.dart'; import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:health/health.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class syncHealthDataButton extends StatefulWidget { class syncHealthDataButton extends StatefulWidget {
@ -26,6 +29,8 @@ class syncHealthDataButton extends StatefulWidget {
class _syncHealthDataButtonState extends State<syncHealthDataButton> { class _syncHealthDataButtonState extends State<syncHealthDataButton> {
List<DataType> dataTypes = List(); List<DataType> dataTypes = List();
List<HealthDataPoint> _healthDataList = [];
List<healthData> Med_InsertTransactionsInputsList = new List(); List<healthData> Med_InsertTransactionsInputsList = new List();
List<healthData> Med_InsertTransactionsInputsList2 = new List(); List<healthData> Med_InsertTransactionsInputsList2 = new List();
@ -56,12 +61,53 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: DefaultButton(TranslationBase.of(context).syncHealthData, () { child: DefaultButton(TranslationBase.of(context).syncHealthData, () {
print("ReadAll"); print("ReadAll");
readAll(); fetchData();
// readAll();
}), }),
), ),
); );
} }
Future fetchData() async {
// get everything from midnight until now
DateTime startDate = DateTime(2021, 11, 01, 0, 0, 0);
DateTime endDate = DateTime(2021, 12, 06, 23, 59, 59);
HealthFactory health = HealthFactory();
// define the types to get
List<HealthDataType> types = [
HealthDataType.STEPS,
HealthDataType.HEART_RATE,
Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING
];
// you MUST request access to the data types before reading them
// bool accessWasGranted = await health.requestAuthorization(types);
await health.requestAuthorization(types);
int steps = 0;
try {
List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, endDate, types);
_healthDataList.addAll(healthData);
} catch (e) {
print("Caught exception in getHealthDataFromTypes: $e");
}
// filter out duplicates
_healthDataList = HealthFactory.removeDuplicates(_healthDataList);
// print the results
_healthDataList.forEach((x) {
if(x.type == HealthDataType.STEPS) {
print("Data point: $x");
steps += x.value.round();
}
});
print("Steps: $steps");
}
void readAll() async { void readAll() async {
TransactionsListID = 1; TransactionsListID = 1;
var MedSubCategoryID = 0; var MedSubCategoryID = 0;
@ -160,7 +206,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
void getAllHealthDataLists() { void getAllHealthDataLists() {
var totalSteps = 0.0; var totalSteps = 0.0;
var totalDistance = 0.0; var totalDistance = 0.0;
// double totalCalories = 0.0 ;
double totalHeartRate = 0.0; double totalHeartRate = 0.0;
double avgTotalHeartRate = 0.0; double avgTotalHeartRate = 0.0;
var counter = 0; var counter = 0;
@ -190,7 +235,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
value.forEach((element) { value.forEach((element) {
if (element['MedCategoryID'] == 6) { if (element['MedCategoryID'] == 6) {
MedCategoryID = 6; MedCategoryID = 6;
totalSteps += element['Value']; totalSteps += element['Value'];
} else if (element['MedCategoryID'] == 7) { } else if (element['MedCategoryID'] == 7) {
MedCategoryID = 7; MedCategoryID = 7;
@ -209,10 +253,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
Med_InsertTransactionsInputsList2.add(new healthData( Med_InsertTransactionsInputsList2.add(new healthData(
MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++)); MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++));
} }
// else if(element['MedCategoryID'] == 8){
//
// totalCalories += element['Value'] ;
// }
}); });
if (counter == 0) { if (counter == 0) {

@ -66,7 +66,7 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
(index) => LakumPointTableRowWidget( (index) => LakumPointTableRowWidget(
false, false,
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].month, .pointsAmountPerMonth[index].month.toString(),
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].pointsPerMonth, .pointsAmountPerMonth[index].pointsPerMonth,
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]

@ -1,15 +1,16 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'dart:io' show Platform; import 'package:url_launcher/url_launcher.dart';
class AvailabilityInfo extends StatelessWidget { class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel; final ProductDetailViewModel previousModel;
const AvailabilityInfo({Key key, this.previousModel}) : super(key: key); final InAppBrowser browser = new InAppBrowser();
AvailabilityInfo({Key key, this.previousModel}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -22,8 +23,8 @@ class AvailabilityInfo extends StatelessWidget {
), ),
) )
: Container( : Container(
margin: EdgeInsets.only(bottom: 40), margin: EdgeInsets.only(bottom: 40),
child: ListView.builder( child: ListView.builder(
physics: ScrollPhysics(), physics: ScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
@ -55,20 +56,12 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton( child: IconButton(
icon: Icon(Icons.location_on), icon: Icon(Icons.location_on),
color: Colors.red, color: Colors.red,
onPressed: () { onPressed: () async {
if (Platform.isIOS) { MapLauncher.showMarker( await MapLauncher.showMarker(
mapType: MapType.apple,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude),
double.parse(previousModel.productLocationService[index].longitude)),
title: previousModel.productLocationService[index].locationDescription,);
} else { MapLauncher.showMarker(
mapType: MapType.google, mapType: MapType.google,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude), coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)),
double.parse(previousModel.productLocationService[index].longitude)), title: previousModel.productLocationService[index].locationDescription,
title: previousModel.productLocationService[index].locationDescription, );
// description: location.locationName,
); }
// MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
}, },
), ),
), ),
@ -90,7 +83,7 @@ class AvailabilityInfo extends StatelessWidget {
); );
}, },
), ),
); );
} }
convertCityName(txt) { convertCityName(txt) {

@ -104,7 +104,8 @@ class _BannerPagerState extends State<BannerPager> {
} }
break; break;
case 2: { case 2: {
Navigator.push(context, FadePage(page: LakumActivationVidaPage())); // Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
Navigator.push(context, FadePage(page: LakumMainPage()));
} }
break; break;
case 5: { case 5: {

@ -74,7 +74,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
this.context = context; this.context = context;
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getOrderDetails(widget.orderModel.id).then((value) { model.getOrderDetails(widget.orderModel.id, widget.orderModel.orderGuid).then((value) {
setState(() { setState(() {
isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty)); isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty));
}); });
@ -533,10 +533,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
model.orderListModel[0].orderStatusId == 10 model.orderListModel[0].orderStatusId == 10
? InkWell( ? InkWell(
onTap: () { onTap: () {
print(widget.orderModel.toString());
print(model.orderListModel.toString());
print("calc = ${5.9 * 3}");
// TODO MOSA
openPayment(model.orderListModel[0], model.user); openPayment(model.orderListModel[0], model.user);
}, },
child: Container( child: Container(
@ -672,11 +668,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
} }
/***
*
* Online payment methods
*/
openPayment( openPayment(
OrderDetailModel order, OrderDetailModel order,
AuthenticatedUser authenticatedUser, AuthenticatedUser authenticatedUser,

@ -280,7 +280,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.emailAddress,
controller: _controller, controller: _controller,
// onChanged: (value) => {validateForm()}, // onChanged: (value) => {validateForm()},
style: TextStyle( style: TextStyle(

@ -20,10 +20,10 @@ class OrderDetailsService extends BaseService{
List<OrderDetailModel> get orderList => _orderList; List<OrderDetailModel> get orderList => _orderList;
Future getOrderDetails(OrderId) async { Future getOrderDetails(OrderId, orderGUID) async {
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId + "/$customerGUID", await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId + "/$orderGUID",
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {

@ -20,7 +20,7 @@ class OrderService extends BaseService {
hasError = false; hasError = false;
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
url = GET_ORDER + "customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId&CustomerguId=$customerGUID"; url = GET_ORDER + "customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund,order_guid&page=$pageId&limit=200&customer_id=$customerId&CustomerguId=$customerGUID";
print(url); print(url);
await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) {

@ -4,11 +4,11 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class WishListService extends BaseService { class WishListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
bool isLogin = false; bool isLogin = false;
List<Wishlist> _wishListProducts = List(); List<Wishlist> _wishListProducts = List();
List<Wishlist> get wishListProducts => _wishListProducts; List<Wishlist> get wishListProducts => _wishListProducts;
// Future<Map> getWishlist() async { // Future<Map> getWishlist() async {
@ -52,18 +52,17 @@ class WishListService extends BaseService {
Future getWishlist() async { Future getWishlist() async {
//TODO we need to check why the customer id comes null //TODO we need to check why the customer id comes null
String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID)?? "0"; String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID) ?? "0";
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_WISHLIST+customerId +"?shopping_cart_type=2", await baseAppClient.getPharmacy(GET_WISHLIST + customerId + "/$customerGUID/" + "?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _wishListProducts.clear();
_wishListProducts.clear(); response['shopping_carts'].forEach((item) {
response['shopping_carts'].forEach((item) { _wishListProducts.add(Wishlist.fromJson(item));
_wishListProducts.add(Wishlist.fromJson(item)); });
}); }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; });
});
} }
} }

@ -187,7 +187,7 @@ class LabResultWidget extends StatelessWidget {
), ),
Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true), Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false), Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false),
InkWell( !checkIfCovidLab(patientLabResultList) ? InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -203,7 +203,7 @@ class LabResultWidget extends StatelessWidget {
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.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
), ),
), ) : Container(),
], ],
), ),
); );

@ -2,21 +2,18 @@ import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'avatar/large_avatar.dart'; import 'avatar/large_avatar.dart';
import 'my_rich_text.dart'; import 'my_rich_text.dart';
import 'dart:io' show Platform;
class HospitalLocation extends StatelessWidget { class HospitalLocation extends StatelessWidget {
final GetHMGLocationsModel location; final GetHMGLocationsModel location;
final bool showCity; final bool showCity;
final String waitingTime; final String waitingTime;
HospitalLocation(this.location, {Key key, this.showCity = false, this.waitingTime}) : super(key: key); HospitalLocation(this.location, {Key key, this.showCity = false, this.waitingTime}) : super(key: key);
@override @override
@ -76,20 +73,17 @@ class HospitalLocation extends StatelessWidget {
), ),
Column( Column(
children: [ children: [
contactButton(Icons.location_on, TranslationBase.of(context).locationa, () { contactButton(
// MapsLauncher.launchCoordinates(double.parse(location.latitude), double.parse(location.longitude), location.locationName); Icons.location_on,
if (Platform.isIOS) { MapLauncher.showMarker( TranslationBase.of(context).locationa,
// mapType: MapType.google, () async {
mapType: MapType.apple, await MapLauncher.showMarker(
coords: Coords(double.parse(location.latitude), double.parse(location.longitude)), mapType: MapType.google,
title: location.locationName,); coords: Coords(double.parse(location.latitude), double.parse(location.longitude)),
} else { MapLauncher.showMarker( title: location.locationName,
mapType: MapType.google, );
coords: Coords(double.parse(location.latitude), double.parse(location.longitude)), },
title: location.locationName, ),
// description: location.locationName,
); }}
),
SizedBox(height: 10), SizedBox(height: 10),
contactButton(Icons.call, TranslationBase.of(context).callNow, () { contactButton(Icons.call, TranslationBase.of(context).callNow, () {
launch("tel://" + location.phoneNumber); launch("tel://" + location.phoneNumber);
@ -121,6 +115,4 @@ class HospitalLocation extends StatelessWidget {
), ),
); );
} }
} }

@ -28,13 +28,11 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
static String SERVICE_URL = static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
@ -204,9 +202,14 @@ class MyInAppBrowser extends InAppBrowser {
openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser) { AuthenticatedUser authenticatedUser, InAppBrowser browser) {
this.browser = browser; this.browser = browser;
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo);
getPatientData(); getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
this.browser.openUrl(url: value); if (order.customValuesXml.contains("ApplePay")) {
safariBrowser.open(url: value);
} else {
this.browser.openUrl(url: value);
}
}); });
} }

Loading…
Cancel
Save