tracker services

merge-requests/390/head
Sultan Khan 5 years ago
parent 2019e804f0
commit c6404a2a0b

@ -12,17 +12,16 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';

@ -1060,7 +1060,7 @@ const Map localizedValues = {
"referralDate": {"en": "Referral Date", "ar": "تاريخ الإحالة"}, "referralDate": {"en": "Referral Date", "ar": "تاريخ الإحالة"},
"patientName": {"en": "Patient Name", "ar": "اسم المريض"}, "patientName": {"en": "Patient Name", "ar": "اسم المريض"},
"referralNumber": {"en": "Referral Number", "ar": "رقم الإحالة"}, "referralNumber": {"en": "Referral Number", "ar": "رقم الإحالة"},
"requestID": {"en": "Request ID", "ar": " رقم الطلب"}, "requestID": {"en": "Req ID", "ar": " رقم الطلب"},
"OrderStatus": {"en": "Status", "ar": "الحاله"}, "OrderStatus": {"en": "Status", "ar": "الحاله"},
"pickupDate": {"en": "Pickup Date", "ar": "التاريخ"}, "pickupDate": {"en": "Pickup Date", "ar": "التاريخ"},
"serviceName": {"en": "Service Name", "ar": " اسم الخدمة"}, "serviceName": {"en": "Service Name", "ar": " اسم الخدمة"},

@ -7,14 +7,10 @@ import '../../../locator.dart';
import '../base_service.dart'; import '../base_service.dart';
class CustomerAddressesService extends BaseService { class CustomerAddressesService extends BaseService {
List<AddressInfo> addressesList = List(); List<AddressInfo> addressesList = List();
CustomerInfo customerInfo; CustomerInfo customerInfo;
Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
Future addAddressInfo({ AddNewAddressRequestModel
addNewAddressRequestModel }) async {
addNewAddressRequestModel.customer.email = customerInfo.email; addNewAddressRequestModel.customer.email = customerInfo.email;
addNewAddressRequestModel.customer.id = customerInfo.customerId; addNewAddressRequestModel.customer.id = customerInfo.customerId;
addNewAddressRequestModel.customer.roleIds = [3]; addNewAddressRequestModel.customer.roleIds = [3];
@ -28,55 +24,44 @@ class CustomerAddressesService extends BaseService {
var date = f.format(DateTime.now().toUtc()) + " GMT"; var date = f.format(DateTime.now().toUtc()) + " GMT";
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date; addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
hasError = false; hasError = false;
await baseAppClient.post(ADD_CUSTOMER_ADDRESS, await baseAppClient.post(ADD_CUSTOMER_ADDRESS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { addressesList.clear();
addressesList.clear(); response["customers"][0]["addresses"].forEach((data) {
response["customers"][0]["addresses"].forEach((data) { addressesList.add(AddressInfo.fromJson(data));
addressesList });
.add(AddressInfo.fromJson(data)); }, onFailure: (String error, int statusCode) {
}); hasError = true;
}, onFailure: (String error, int statusCode) { super.error = error;
hasError = true; }, body: addNewAddressRequestModel.toJson(), isAllowAny: true);
super.error = error;
}, body: addNewAddressRequestModel.toJson(), isAllowAny: true);
} }
Future getCustomerAddresses() async { Future getCustomerAddresses() async {
Map<String, String> queryParams = { Map<String, String> queryParams = {'fields': 'addresses'};
'fields':'addresses'
};
hasError = false; hasError = false;
await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { addressesList.clear();
addressesList.clear(); response["customers"][0]["addresses"].forEach((data) {
response["customers"][0]["addresses"].forEach((data) { addressesList.add(AddressInfo.fromJson(data));
addressesList });
.add(AddressInfo.fromJson(data)); }, onFailure: (String error, int statusCode) {
}); hasError = true;
}, onFailure: (String error, int statusCode) { super.error = error;
hasError = true; }, queryParams: queryParams, isExternal: true);
super.error = error;
}, queryParams: queryParams, isExternal: true);
} }
Future getCustomerInfo() async { Future getCustomerInfo() async {
Map<String, String> queryParams = { Map<String, String> queryParams = {'FileNumber': '${user.patientID}'};
'FileNumber':'${user.patientID}'
};
hasError = false; hasError = false;
await baseAppClient.getPharmacy(BASE_PHARMACY_URL+GET_CUSTOMER_INFO, await baseAppClient.getPharmacy(BASE_PHARMACY_URL + GET_CUSTOMER_INFO, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { customerInfo = CustomerInfo.fromJson(response);
customerInfo= CustomerInfo.fromJson(response); }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; }, queryParams: queryParams, isExternal: true);
}, queryParams: queryParams, isExternal: true);
} }
} }
class CustomerInfo { class CustomerInfo {
bool isRegistered; bool isRegistered;
String userName; String userName;
@ -86,14 +71,7 @@ class CustomerInfo {
String mobileNumber; String mobileNumber;
int customerId; int customerId;
CustomerInfo( CustomerInfo({this.isRegistered, this.userName, this.password, this.email, this.errorMessage, this.mobileNumber, this.customerId});
{this.isRegistered,
this.userName,
this.password,
this.email,
this.errorMessage,
this.mobileNumber,
this.customerId});
CustomerInfo.fromJson(Map<String, dynamic> json) { CustomerInfo.fromJson(Map<String, dynamic> json) {
isRegistered = json['IsRegistered']; isRegistered = json['IsRegistered'];
@ -118,7 +96,6 @@ class CustomerInfo {
} }
} }
class AddressInfo { class AddressInfo {
String id; String id;
String firstName; String firstName;
@ -141,23 +118,23 @@ class AddressInfo {
AddressInfo( AddressInfo(
{this.id, {this.id,
this.firstName, this.firstName,
this.lastName, this.lastName,
this.email, this.email,
this.company, this.company,
this.countryId, this.countryId,
this.country, this.country,
this.stateProvinceId, this.stateProvinceId,
this.city, this.city,
this.address1, this.address1,
this.address2, this.address2,
this.zipPostalCode, this.zipPostalCode,
this.phoneNumber, this.phoneNumber,
this.faxNumber, this.faxNumber,
this.customerAttributes, this.customerAttributes,
this.createdOnUtc, this.createdOnUtc,
this.province, this.province,
this.latLong}); this.latLong});
AddressInfo.fromJson(Map<String, dynamic> json) { AddressInfo.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];

@ -19,14 +19,12 @@ class HomeHealthCareService extends BaseService {
List<GetOrderDetailByOrderIDResponseModel> hhcAllOrderDetail = List(); List<GetOrderDetailByOrderIDResponseModel> hhcAllOrderDetail = List();
List<AddressInfo> addressesList = List(); List<AddressInfo> addressesList = List();
dynamic hhcResponse;
bool isOrderUpdated; bool isOrderUpdated;
CustomerInfo customerInfo; CustomerInfo customerInfo;
Future getHHCAllServices( Future getHHCAllServices(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(HHC_GET_ALL_SERVICES, await baseAppClient.post(HHC_GET_ALL_SERVICES, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
hhcAllServicesList.clear(); hhcAllServicesList.clear();
response['PatientER_HHC_GetAllServicesList'].forEach((data) { response['PatientER_HHC_GetAllServicesList'].forEach((data) {
hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data)); hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data));
@ -38,16 +36,12 @@ class HomeHealthCareService extends BaseService {
} }
Future getHHCAllPresOrders() async { Future getHHCAllPresOrders() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD, await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear(); hhcAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService()) if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService()) hhcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
hhcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -60,12 +54,10 @@ class HomeHealthCareService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PresOrderID'] = presOrderID; body['PresOrderID'] = presOrderID;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_ORDER_DETAIL_BY_ID, await baseAppClient.post(GET_ORDER_DETAIL_BY_ID, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
hhcAllOrderDetail.clear(); hhcAllOrderDetail.clear();
response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) { response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) {
hhcAllOrderDetail hhcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -75,8 +67,7 @@ class HomeHealthCareService extends BaseService {
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -86,14 +77,11 @@ class HomeHealthCareService extends BaseService {
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { hhcResponse = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: order.toJson()); }, body: order.toJson());
} }
} }

@ -18,42 +18,30 @@ import '../../../locator.dart';
import 'add_new_address_Request_Model.dart'; import 'add_new_address_Request_Model.dart';
class HomeHealthCareViewModel extends BaseViewModel { class HomeHealthCareViewModel extends BaseViewModel {
HomeHealthCareService _homeHealthCareService = HomeHealthCareService _homeHealthCareService = locator<HomeHealthCareService>();
locator<HomeHealthCareService>();
CustomerAddressesService _customerAddressesService = CustomerAddressesService _customerAddressesService = locator<CustomerAddressesService>();
locator<CustomerAddressesService>();
List<HHCGetAllServicesResponseModel> get hhcAllServicesList => List<HHCGetAllServicesResponseModel> get hhcAllServicesList => _homeHealthCareService.hhcAllServicesList;
_homeHealthCareService.hhcAllServicesList;
List<AddressInfo> get addressesList => _customerAddressesService.addressesList;
List<AddressInfo> get addressesList => List<GetHHCAllPresOrdersResponseModel> get hhcAllPresOrders => _homeHealthCareService.hhcAllPresOrdersList;
_customerAddressesService.addressesList;
List<GetHHCAllPresOrdersResponseModel> get hhcAllPresOrders => List<GetOrderDetailByOrderIDResponseModel> get hhcAllOrderDetail => _homeHealthCareService.hhcAllOrderDetail;
_homeHealthCareService.hhcAllPresOrdersList;
List<GetOrderDetailByOrderIDResponseModel> get hhcAllOrderDetail =>
_homeHealthCareService.hhcAllOrderDetail;
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>(); PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
GetHHCAllPresOrdersResponseModel pendingOrder; GetHHCAllPresOrdersResponseModel pendingOrder;
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List(); List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List();
dynamic get hhcResponse => _homeHealthCareService.hhcResponse;
Future getHHCAllServices() async { Future getHHCAllServices() async {
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel = HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel = new HHCGetAllServicesRequestModel();
new HHCGetAllServicesRequestModel();
//setState(ViewState.Busy); //setState(ViewState.Busy);
await _homeHealthCareService await _homeHealthCareService.getHHCAllServices(hHCGetAllServicesRequestModel);
.getHHCAllServices(hHCGetAllServicesRequestModel);
if (_homeHealthCareService.hasError) { if (_homeHealthCareService.hasError) {
error = _homeHealthCareService.error; error = _homeHealthCareService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -70,23 +58,19 @@ class HomeHealthCareViewModel extends BaseViewModel {
error = _homeHealthCareService.error; error = _homeHealthCareService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
pendingOrder = _homeHealthCareService.hhcAllPresOrdersList pendingOrder = _homeHealthCareService.hhcAllPresOrdersList.firstWhere((element) => element.status == 1 || element.status == 2, orElse: () => null);
.firstWhere((element) => element.status == 1 || element.status == 2,
orElse: () => null);
if (pendingOrder != null) { if (pendingOrder != null) {
await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD);
setState(ViewState.Idle); setState(ViewState.Idle);
} else { } else {
getHHCAllServices(); getHHCAllServices();
} }
} }
} }
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _homeHealthCareService.updateHHCPresOrder( await _homeHealthCareService.updateHHCPresOrder(updatePresOrderRequestModel);
updatePresOrderRequestModel);
if (_homeHealthCareService.hasError) { if (_homeHealthCareService.hasError) {
error = _homeHealthCareService.error; error = _homeHealthCareService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -108,11 +92,9 @@ class HomeHealthCareViewModel extends BaseViewModel {
} }
} }
Future getCustomerAddresses() async { Future getCustomerAddresses() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _customerAddressesService.getCustomerAddresses( await _customerAddressesService.getCustomerAddresses();
);
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -123,7 +105,7 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future getCustomerInfo() async { Future getCustomerInfo() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{ await _pharmacyModuleService.generatePharmacyToken().then((value) async {
await _customerAddressesService.getCustomerInfo(); await _customerAddressesService.getCustomerInfo();
}); });
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
@ -134,15 +116,11 @@ class HomeHealthCareViewModel extends BaseViewModel {
} }
} }
Future addAddressInfo( Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
{AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{ await _pharmacyModuleService.generatePharmacyToken().then((value) async {
await _customerAddressesService.addAddressInfo( await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
addNewAddressRequestModel: addNewAddressRequestModel
);
}); });
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
@ -152,6 +130,4 @@ class HomeHealthCareViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
}
}

@ -34,31 +34,22 @@ class BloodPressureViewMode extends BaseViewModel {
} else { } else {
clearDate(); clearDate();
bloodPressureService.weekDiabtectResultAverageList.forEach((element) { bloodPressureService.weekDiabtectResultAverageList.forEach((element) {
weightWeekTimeSeriesDataTop weightWeekTimeSeriesDataTop.add(TimeSeriesSales2(element.bloodPressureDate, element.dailyDiastolicPressureAverageResult.toDouble()));
.add(TimeSeriesSales2(element.bloodPressureDate, element.dailyDiastolicPressureAverageResult.toDouble())); weightWeekTimeSeriesDataLow.add(TimeSeriesSales2(element.bloodPressureDate, element.dailySystolicePressureAverageResult.toDouble()));
weightWeekTimeSeriesDataLow
.add(TimeSeriesSales2(element.bloodPressureDate, element.dailySystolicePressureAverageResult.toDouble()));
for (int index = 0; index < bloodPressureService.monthDiabtectResultAverageList.length; index++) {
weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(
index,
bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult
.toDouble()));
weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(
index,
bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult
.toDouble()));
}
bloodPressureService.yearDiabtecResultAverageList.forEach((element) {
weightYearTimeSeriesDataTop
.add(TimeSeriesSales2(element.date, element.monthSystolicePressureAverageResult.toDouble()));
weightYearTimeSeriesDataLow
.add(TimeSeriesSales2(element.date, element.monthDiastolicPressureAverageResult.toDouble()));
});
}); });
for (int index = 0; index < bloodPressureService.monthDiabtectResultAverageList.length; index++) {
weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble()));
weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble()));
}
bloodPressureService.yearDiabtecResultAverageList.forEach((element) {
weightYearTimeSeriesDataTop.add(TimeSeriesSales2(element.date, element.monthSystolicePressureAverageResult.toDouble()));
weightYearTimeSeriesDataLow.add(TimeSeriesSales2(element.date, element.monthDiastolicPressureAverageResult.toDouble()));
});
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -84,25 +75,12 @@ class BloodPressureViewMode extends BaseViewModel {
} }
} }
Future addORUpdateDiabtecResult( Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, bool isUpdate = false}) async {
{String bloodPressureDate,
String diastolicPressure,
String systolicePressure,
int measuredArm,
bool isUpdate = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
if (!isUpdate) if (!isUpdate)
await bloodPressureService.addDiabtecResult( await bloodPressureService.addDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm);
bloodPressureDate: bloodPressureDate,
diastolicPressure: diastolicPressure,
systolicePressure: systolicePressure,
measuredArm: measuredArm);
else else
await bloodPressureService.updateDiabtecResult( await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm);
bloodPressureDate: bloodPressureDate,
diastolicPressure: diastolicPressure,
systolicePressure: systolicePressure,
measuredArm: measuredArm);
if (bloodPressureService.hasError) { if (bloodPressureService.hasError) {
error = bloodPressureService.error; error = bloodPressureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -9,9 +9,7 @@ class ConfirmCancelOrderDialog extends StatefulWidget {
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
final Function onTap; final Function onTap;
ConfirmCancelOrderDialog({Key key, this.model, this.onTap});
ConfirmCancelOrderDialog(
{Key key, this.model, this.onTap});
@override @override
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();
@ -26,7 +24,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), contentPadding: EdgeInsets.all(20),
title: Center( title: Center(
child: Texts( child: Texts(
TranslationBase.of(context).confirm, TranslationBase.of(context).confirm,
@ -37,14 +35,16 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
Column( Column(
children: [ children: [
Divider(), Divider(),
SizedBox(
height: 10.0,
),
Center( Center(
child: Texts( child: Texts(
TranslationBase.of(context).cancelOrderMsg , TranslationBase.of(context).cancelOrderMsg,
color: Colors.grey,
), ),
), ),
SizedBox( SizedBox(
height: 5.0, height: 10,
), ),
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -76,7 +76,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () async{ onTap: () async {
widget.onTap(); widget.onTap();
Navigator.pop(context); Navigator.pop(context);
}, },
@ -84,9 +84,9 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
)), )),
), ),
), ),
), ),
@ -98,6 +98,3 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
); );
} }
} }

@ -13,7 +13,8 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget { class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel; final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
@ -158,10 +159,15 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
disabled: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0, disabled: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0,
color: Colors.grey[800], color: Colors.grey[800],
onTap: () async { onTap: () async {
await widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel); widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) => {
if (widget.model.state != ViewState.ErrorLocal) { print(widget.model.hhcResponse),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: NewHomeHealthCarePage)); Navigator.push(
} context,
FadePage(
page: HomeHealthCarePage(),
),
)
});
}, },
textColor: Theme.of(context).backgroundColor), textColor: Theme.of(context).backgroundColor),
), ),

@ -119,267 +119,271 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Row( child: Container(
children: [ margin: EdgeInsets.all(10),
Expanded( child: Row(
flex: 3, children: [
child: ClipRRect( Expanded(
borderRadius: const BorderRadius.all(Radius.circular(20.0)), flex: 3,
child: Container( child: ClipRRect(
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), borderRadius: const BorderRadius.all(Radius.circular(20.0)),
margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), child: Container(
decoration: BoxDecoration(boxShadow: [ padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
BoxShadow(color: Color(0xffcd9e1b), offset: Offset(-10, 0)), margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), decoration: BoxDecoration(boxShadow: [
child: Row( BoxShadow(color: Color(0xffcd9e1b), offset: Offset(-10, 0)),
children: [ ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
Expanded( child: Row(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Expanded(
TranslationBase.of(context).OrderStatus + child: Column(
' ' + mainAxisAlignment: MainAxisAlignment.start,
(projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
bold: false,
fontSize: 12,
color: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Texts(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
fontSize: 14,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Row(
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(), crossAxisAlignment: CrossAxisAlignment.start,
bold: false, children: [
fontSize: 18, Texts(
), TranslationBase.of(context).OrderStatus +
Texts( ' ' +
TranslationBase.of(context).serviceName, (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
fontSize: 12, bold: false,
fontSize: 12,
color: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
],
), ),
...List.generate( Row(
widget.model.hhcAllOrderDetail.length, mainAxisAlignment: MainAxisAlignment.end,
(index) => Container( children: [
child: Texts( Texts(
projectViewModel.isArabic DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
? widget.model.hhcAllOrderDetail[index].descriptionN
: widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 14, fontSize: 14,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
fontWeight: FontWeight.w600,
fontSize: 18,
),
Texts(
TranslationBase.of(context).serviceName,
fontSize: 12,
fontWeight: FontWeight.w600,
),
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic
? widget.model.hhcAllOrderDetail[index].descriptionN
: widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
),
],
), ),
), SecondaryButton(
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
],
// )
// ],
// )
// ],
), ),
], ],
), ))
SecondaryButton(
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
], ],
// ) ))),
// ], )
// ) ],
// ], ))
),
],
))
],
))),
)
],
))
// Row( // Row(
// children: [ // children: [
// Expanded( // Expanded(
// flex: 1, // flex: 1,
// child: ClipRRect( // child: ClipRRect(
// borderRadius: const BorderRadius.all(Radius.circular(20.0)), // borderRadius: const BorderRadius.all(Radius.circular(20.0)),
// child: Container( // child: Container(
// padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), // padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
// margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7), // margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// boxShadow: [ // boxShadow: [
// BoxShadow(color: Colors.green, offset: Offset(-5, 0)), // BoxShadow(color: Colors.green, offset: Offset(-5, 0)),
// ], // ],
// )))), // )))),
// Expanded( // Expanded(
// flex: 5, // flex: 5,
// child: Column( // child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// children: [ // children: [
// Container( // Container(
// width: double.infinity, // width: double.infinity,
// padding: EdgeInsets.all(5), // padding: EdgeInsets.all(5),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// border: Border( // border: Border(
// bottom: BorderSide( // bottom: BorderSide(
// color: Colors.grey, // color: Colors.grey,
// width: 1.0, // width: 1.0,
// ), // ),
// ), // ),
// // borderRadius: BorderRadius.circular(12), // // borderRadius: BorderRadius.circular(12),
// ), // ),
// child: Row( // child: Row(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// children: [ // children: [
// Texts( // Texts(
// TranslationBase.of(context).OrderStatus, // TranslationBase.of(context).OrderStatus,
// bold: false, // bold: false,
// fontSize: 12, // fontSize: 12,
// ), // ),
// SizedBox( // SizedBox(
// height: 4, // height: 4,
// ), // ),
// Texts( // Texts(
// projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description, // projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description,
// fontSize: 12, // fontSize: 12,
// ), // ),
// ], // ],
// ), // ),
// ), // ),
// Container( // Container(
// width: double.infinity, // width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), // padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// border: Border( // border: Border(
// bottom: BorderSide( // bottom: BorderSide(
// color: Colors.grey, // color: Colors.grey,
// width: 1.0, // width: 1.0,
// ), // ),
// ), // ),
// // borderRadius: BorderRadius.circular(12), // // borderRadius: BorderRadius.circular(12),
// ), // ),
// child: Column( // child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// children: [ // children: [
// Texts( // Texts(
// TranslationBase.of(context).requestID, // TranslationBase.of(context).requestID,
// bold: false, // bold: false,
// fontSize: 13, // fontSize: 13,
// ), // ),
// SizedBox( // SizedBox(
// height: 4, // height: 4,
// ), // ),
// Texts( // Texts(
// widget.model.pendingOrder.iD.toString(), // widget.model.pendingOrder.iD.toString(),
// fontSize: 22, // fontSize: 22,
// ), // ),
// ], // ],
// ), // ),
// ), // ),
// Container( // Container(
// width: double.infinity, // width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), // padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// border: Border( // border: Border(
// bottom: BorderSide( // bottom: BorderSide(
// color: Colors.grey, // color: Colors.grey,
// width: 1.0, // width: 1.0,
// ), // ),
// ), // ),
// // borderRadius: BorderRadius.circular(12), // // borderRadius: BorderRadius.circular(12),
// ), // ),
// child: Column( // child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// children: [ // children: [
// Texts( // Texts(
// TranslationBase.of(context).pickupDate, // TranslationBase.of(context).pickupDate,
// bold: false, // bold: false,
// fontSize: 13, // fontSize: 13,
// ), // ),
// SizedBox( // SizedBox(
// height: 4, // height: 4,
// ), // ),
// Texts( // Texts(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
// fontSize: 22, // fontSize: 22,
// ), // ),
// ], // ],
// ), // ),
// ), // ),
// ...List.generate( // ...List.generate(
// widget.model.hhcAllOrderDetail.length, // widget.model.hhcAllOrderDetail.length,
// (index) => Container( // (index) => Container(
// width: double.infinity, // width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), // padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// border: Border( // border: Border(
// bottom: BorderSide( // bottom: BorderSide(
// color: Colors.grey, // color: Colors.grey,
// width: 1.0, // width: 1.0,
// ), // ),
// ), // ),
// // borderRadius: BorderRadius.circular(12), // // borderRadius: BorderRadius.circular(12),
// color: Theme.of(context).primaryColor), // color: Theme.of(context).primaryColor),
// child: Column( // child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// children: [ // children: [
// Texts( // Texts(
// TranslationBase.of(context).serviceName, // TranslationBase.of(context).serviceName,
// bold: false, // bold: false,
// fontSize: 13, // fontSize: 13,
// ), // ),
// SizedBox( // SizedBox(
// height: 4, // height: 4,
// ), // ),
// Texts( // Texts(
// projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description, // projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description,
// fontSize: 22, // fontSize: 22,
// bold: true, // bold: true,
// ), // ),
// ], // ],
// ), // ),
// ), // ),
// ), // ),
// SizedBox( // SizedBox(
// height: 12, // height: 12,
// ), // ),
// Center( // Center(
// child: Container( // child: Container(
// width: MediaQuery.of(context).size.width * 0.85, // width: MediaQuery.of(context).size.width * 0.85,
// child: SecondaryButton( // child: SecondaryButton(
// label: TranslationBase.of(context).cancel.toUpperCase(), // label: TranslationBase.of(context).cancel.toUpperCase(),
// onTap: () { // onTap: () {
// showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
// }, // },
// color: Colors.red[800], // color: Colors.red[800],
// disabled: false, // disabled: false,
// textColor: Theme.of(context).backgroundColor), // textColor: Theme.of(context).backgroundColor),
// ), // ),
// ), // ),
// SizedBox( // SizedBox(
// height: 12, // height: 12,
// ), // ),
// ], // ],
// ), // ),
// ) // )
// ], // ],
// ), // ),
//), //),
) ))
: NewHomeHealthCareStepOnePage( : NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab, changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,

@ -24,23 +24,18 @@ class OrdersLogDetailsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage( void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
model: model, model: model,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
UpdatePresOrderRequestModel(
presOrderID: order.iD,
rejectionReason: "",
presOrderStatus: 4, editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel); await model.updateHHCPresOrder(updatePresOrderRequestModel);
if(model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
@ -54,203 +49,305 @@ class OrdersLogDetailsPage extends StatelessWidget {
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(10),
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.94, widthFactor: 0.94,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 50,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: model.hhcAllPresOrders.map((order) { children: model.hhcAllPresOrders.map((order) {
return Container( return Row(
width: double.infinity, children: [
margin: EdgeInsets.only(top: 15), Expanded(
decoration: BoxDecoration( flex: 3,
border: child: ClipRRect(
Border.all(color: Colors.grey, width: 1), borderRadius: const BorderRadius.all(Radius.circular(20.0)),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15, right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
order.iD.toString(),
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15, right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic ? order.descriptionN : order.description,
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15, right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.pickupDate,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(order.createdOn)),
fontSize: 22,
),
],
),
),
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15, right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).orderLocation,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic ?order.nearestProjectDescription
.toString() :
order.nearestProjectDescriptionN
.toString(),
fontSize: 22,
),
],
),
),
SizedBox(
height: 12,
),
if (order.status == 1 ||order.status == 2 )
Center(
child: Container( child: Container(
width: MediaQuery padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
.of(context) margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
.size decoration: BoxDecoration(boxShadow: [
.width * BoxShadow(
0.85, color: order.status == 4
child: SecondaryButton( ? Colors.red[900]
label: "Cancel".toUpperCase(), : order.status == 3
onTap: () { ? Colors.green[400]
showConfirmMessage(model, order); : Color(0xffcd9e1b),
} offset: Offset(-10, 0)),
, ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
color: Colors.red[800], child: Row(
disabled: false, children: [
textColor: Theme Expanded(
.of(context) child: Column(
.backgroundColor), mainAxisAlignment: MainAxisAlignment.start,
), crossAxisAlignment: CrossAxisAlignment.start,
), children: [
SizedBox( Row(
height: 12, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
], Texts(
), TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description),
bold: false,
fontSize: 12,
color: order.status == 4
? Colors.red[900]
: order.status == 3
? Colors.green[400]
: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Texts(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
fontSize: 14,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).requestID + ' ' + order.iD.toString(),
bold: false,
fontSize: 18,
),
],
),
(order.status == 1 || order.status == 2)
? SecondaryButton(
onTap: () {
showConfirmMessage(model, order);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
: SizedBox()
],
// )
// ],
// )
// ],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).orderLocation,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
fontSize: 13,
),
],
),
],
))
],
))),
)
],
); );
// return Container(
// width: double.infinity,
// margin: EdgeInsets.only(top: 15),
// decoration: BoxDecoration(
// border:
// Border.all(color: Colors.grey, width: 1),
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// SizedBox(
// height: 12,
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(
// left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase
// .of(context)
// .requestID,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// order.iD.toString(),
// fontSize: 22,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(
// left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase
// .of(context)
// .OrderStatus,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// projectViewModel.isArabic ? order.descriptionN : order.description,
// fontSize: 22,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(
// left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase
// .of(context)
// .pickupDate,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// DateUtil.getDayMonthYearDateFormatted(
// DateUtil.convertStringToDate(order.createdOn)),
// fontSize: 22,
// ),
// ],
// ),
// ),
// SizedBox(
// height: 12,
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(
// left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).orderLocation,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// !projectViewModel.isArabic ?order.nearestProjectDescription
// .toString() :
// order.nearestProjectDescriptionN
// .toString(),
// fontSize: 22,
// ),
// ],
// ),
// ),
// SizedBox(
// height: 12,
// ),
// if (order.status == 1 ||order.status == 2 )
// Center(
// child: Container(
// width: MediaQuery
// .of(context)
// .size
// .width *
// 0.85,
// child: SecondaryButton(
// label: "Cancel".toUpperCase(),
// onTap: () {
// showConfirmMessage(model, order);
// }
// ,
// color: Colors.red[800],
// disabled: false,
// textColor: Theme
// .of(context)
// .backgroundColor),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// ],
// ),
// );
}).toList()) }).toList())
], ],
), ),

@ -33,8 +33,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AnciallryOrdersViewModel>( return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrdersDetails( onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
widget.appoNo, widget.orderNo, widget.projectID),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
@ -156,8 +155,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
Texts(" : "), Texts(" : "),
Texts( Texts(
DateUtil.getDayMonthYearDateFormatted( DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(model.ancillaryListsDetails[0].appointmentDate),
model.ancillaryListsDetails[0].appointmentDate),
), ),
) )
], ],
@ -227,27 +225,25 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
Row( Row(
children: [], children: [],
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
mainAxisAlignment: MainAxisAlignment.spaceEvenly, Texts(
children: [ TranslationBase.of(context).price,
Texts( color: Colors.grey[500],
TranslationBase.of(context).price, fontSize: 14,
color: Colors.grey[500], ),
fontSize: 14, SizedBox(width: 15),
), Texts(
SizedBox(width: 15), TranslationBase.of(context).vat,
Texts( color: Colors.grey[500],
TranslationBase.of(context).vat, fontSize: 14,
color: Colors.grey[500], ),
fontSize: 14, SizedBox(width: 15),
), Texts(
SizedBox(width: 15), TranslationBase.of(context).total,
Texts( color: Colors.grey[500],
TranslationBase.of(context).total, fontSize: 14,
color: Colors.grey[500], ),
fontSize: 14, ]),
),
]),
], ],
), ),
Divider( Divider(
@ -258,10 +254,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} }
Widget getAncillaryDetails(model) { Widget getAncillaryDetails(model) {
Map newMap = groupBy( Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName);
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList,
(obj) => obj.procedureCategoryName);
print(newMap);
return Padding(padding: EdgeInsets.only(top: 10, bottom: 10), child: getHeaderDetails(newMap)); return Padding(padding: EdgeInsets.only(top: 10, bottom: 10), child: getHeaderDetails(newMap));
} }

@ -15,161 +15,99 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import "package:collection/collection.dart";
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class WeightMonthlyPage extends StatelessWidget { class WeightMonthlyPage extends StatelessWidget {
final WeightPressureViewModel model; final WeightPressureViewModel model;
const WeightMonthlyPage({ WeightMonthlyPage({
Key key, Key key,
this.model, this.model,
}) : super(key: key); }) : super(key: key);
List<List> monthlyGroup = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: ListView( body: ListView(
children: [ children: [
Container( Container(
width: double.maxFinite, width: double.maxFinite,
color: Colors.white, color: Colors.white,
child: MonthLineChartCurved( child: MonthLineChartCurved(
horizontalInterval: 1.0, horizontalInterval: 1.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData.isEmpty?[TimeSeriesSales3(0, 0.0)]:model.weighMonthTimeSeriesData, timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)), )),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
model.weighMonthTimeSeriesData.isEmpty? Container( model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
):Table( )
border: TableBorder.symmetric( : Column(children: [
inside: BorderSide(width: 2.0, color: Colors.grey[300]), for (var monthly in monthlyGroup)
), Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
children: fullData(context, projectViewModel, model), Container(
), width: double.maxFinite,
], padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
) child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
// 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
])
], ],
), ),
)
],
),
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).time),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).value),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
], ],
), ),
); );
model.monthWeightMeasurementResult.forEach( model.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
child: Container( isCapitable: false),
height: 70, Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false),
color: Colors.white,
child: Center(
child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.weightDate.hour}:${diabtec.weightDate.minute}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.weightMeasured}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
], ],
), ),
); );
@ -177,4 +115,10 @@ class WeightMonthlyPage extends StatelessWidget {
); );
return tableRow; return tableRow;
} }
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.monthWeightMeasurementResult, (obj) => DateUtil.getMonth(obj.weightDate.month) + ' ' + obj.weightDate.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
} }

@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'AddWeightPage.dart'; import 'AddWeightPage.dart';
class WeightWeeklyPage extends StatelessWidget { class WeightWeeklyPage extends StatelessWidget {
@ -27,122 +27,59 @@ class WeightWeeklyPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
horizontalInterval: 1.0, horizontalInterval: 1.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData.isEmpty timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
? [TimeSeriesSales2(DateTime.now(), 0.0)] indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
: model.weightWeekTimeSeriesData, ),
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, ),
), SizedBox(
), height: 12,
SizedBox( ),
height: 12, Padding(
), padding: const EdgeInsets.all(8.0),
Padding( child: Texts(TranslationBase.of(context).details),
padding: const EdgeInsets.all(8.0), ),
child: Texts(TranslationBase.of(context).details), Container(
), padding: EdgeInsets.all(10),
Container( color: Colors.transparent,
padding: EdgeInsets.all(10), child: Column(
color: Colors.transparent, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, model.weightWeekTimeSeriesData.isEmpty
children: <Widget>[ ? Container(
model.weightWeekTimeSeriesData.isEmpty? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
):Table( )
border: TableBorder.symmetric( : Table(
inside: columnWidths: {
BorderSide(width: 2.0, color: Colors.grey[300]), 0: FlexColumnWidth(2.5),
), },
children: fullData(context, projectViewModel, model), children: fullData(context, projectViewModel, model),
), ),
],
),
)
], ],
), ),
)
],
),
); );
} }
List<TableRow> fullData(BuildContext context, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).time),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).measured),
borderRadius: BorderRadius.only( Utils.tableColumnTitle(TranslationBase.of(context).edit),
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).edit,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
], ],
), ),
); );
@ -151,72 +88,47 @@ class WeightWeeklyPage extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
child: Container( isCapitable: false),
height: 70, Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false),
color: Colors.white, Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
child: Center( SizedBox(height: 12),
child: Texts( Container(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', child: InkWell(
textAlign: TextAlign.center, onTap: () {
fontSize: 12, Navigator.push(
), context,
), FadePage(
), page: AddWeightPage(
), isUpdate: true,
Container( dayWeightDate: diabtec.weightDate,
height: 70, measureTimeSelectedType: 'Kg',
padding: EdgeInsets.all(10), weightValue: diabtec.weightMeasured.toString(),
color: Colors.white, lineItemNo: diabtec.lineItemNo,
child: Center( weightUnit: int.parse(diabtec.unit),
child: Texts( model: model,
'${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', ),
textAlign: TextAlign.center, ),
fontSize: 12, );
), },
), child: Container(
), // height: 70,
Container( // padding: EdgeInsets.all(10),
child: Container( child: Icon(
height: 70, Icons.edit,
padding: EdgeInsets.all(10), color: Color(0xff575757),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.weightMeasured}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
isUpdate: true,
dayWeightDate: diabtec.weightDate,
measureTimeSelectedType: 'Kg',
weightValue: diabtec.weightMeasured.toString(),
lineItemNo: diabtec.lineItemNo,
weightUnit: int.parse(diabtec.unit),
model: model,
), ),
), ),
);
},
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Icon(Icons.edit),
), ),
), ),
), SizedBox(height: 6),
Divider(
height: 1,
color: Color(0xffEFEFEF),
thickness: 1,
)
]),
], ],
), ),
); );

@ -15,161 +15,98 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import "package:collection/collection.dart";
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class WeightYearPage extends StatelessWidget { class WeightYearPage extends StatelessWidget {
final WeightPressureViewModel model; final WeightPressureViewModel model;
const WeightYearPage({ WeightYearPage({
Key key, Key key,
this.model, this.model,
}) : super(key: key); }) : super(key: key);
List<List> monthlyGroup = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: body: ListView(
ListView( children: [
children: [ Container(
Container( width: double.maxFinite,
width: double.maxFinite, color: Colors.white,
color: Colors.white, child: LineChartCurved(
child: LineChartCurved( horizontalInterval: 2.0,
horizontalInterval: 2.0, title: TranslationBase.of(context).weight,
title: TranslationBase.of(context).weight, timeSeries: model.weightYearTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesData,
timeSeries: model.weightYearTimeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesData, indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "", )),
)), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Padding(
Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(TranslationBase.of(context).details),
child: Texts(TranslationBase.of(context).details), ),
), Container(
Container( padding: EdgeInsets.all(10),
padding: EdgeInsets.all(10), color: Colors.transparent,
color: Colors.transparent, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ model.weightYearTimeSeriesData.isEmpty
model.weightYearTimeSeriesData.isEmpty? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
):Table( )
border: TableBorder.symmetric( : Column(children: [
inside: BorderSide(width: 2.0, color: Colors.grey[300]), for (var monthly in monthlyGroup)
), Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
children: fullData(context, projectViewModel, model), Container(
), width: double.maxFinite,
], padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
) child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
], ],
), ),
)
],
),
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).time),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).value),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
], ],
), ),
); );
model.yearWeightMeasurementResult.forEach( model.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
child: Container( isCapitable: false),
height: 70, Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false),
color: Colors.white,
child: Center(
child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.weightDate.hour}:${diabtec.weightDate.minute}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.weightMeasured}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
], ],
), ),
); );
@ -177,4 +114,10 @@ class WeightYearPage extends StatelessWidget {
); );
return tableRow; return tableRow;
} }
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.yearWeightMeasurementResult.reversed, (obj) => DateUtil.getMonth(obj.weightDate.month) + ' ' + obj.weightDate.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
} }

@ -72,27 +72,31 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
) )
], ],
), ),
floatingActionButton: InkWell( floatingActionButton: Stack(children: [
onTap: () { Positioned(
Navigator.push( bottom: 80,
context, right: 0,
FadePage( child: InkWell(
page: AddBloodPressurePage( onTap: () {
model: model, Navigator.push(
))); context,
}, FadePage(
child: Container( page: AddBloodPressurePage(
width: 55, model: model,
height: 55, )));
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), },
child: Center( child: Container(
child: Icon( width: 50,
Icons.add, height: 50,
color: Colors.white, decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
), child: Center(
), child: Icon(
), Icons.add,
), color: Colors.white,
),
)),
))
]),
bottomSheet: Container( bottomSheet: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 70.0, height: 70.0,

@ -9,17 +9,19 @@ 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:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import "package:collection/collection.dart";
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class BloodPressureMonthlyPage extends StatelessWidget { class BloodPressureMonthlyPage extends StatelessWidget {
final BloodPressureViewMode model; final BloodPressureViewMode model;
const BloodPressureMonthlyPage({Key key, this.model}) : super(key: key); BloodPressureMonthlyPage({Key key, this.model}) : super(key: key);
List<List> monthlyGroup = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
@ -53,12 +55,23 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Column(children: [
border: TableBorder.symmetric( for (var monthly in monthlyGroup)
inside: BorderSide(width: 2.0, color: Colors.grey[300]), Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
), Container(
children: fullData(context, projectViewModel, model), width: double.maxFinite,
), padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(1.8),
2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
SizedBox(height: 80) SizedBox(height: 80)
], ],
), ),
@ -68,121 +81,29 @@ class BloodPressureMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode model) { List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).time),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).arm),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).sysdias),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).arm,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).sysdias,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
], ],
), ),
); );
model.monthDiabtecPatientResult.reversed.forEach( model.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue(
color: Colors.white, '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}',
child: Center( isCapitable: false),
child: Texts( Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false),
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false),
fontSize: 12, Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false),
textAlign: TextAlign.center,
),
),
height: 40,
),
Container(
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}',
fontSize: 12,
),
),
height: 40),
Container(
color: Colors.white,
child: Center(
child: Texts(
diabtec.measuredArmDesc,
fontSize: 12,
),
),
height: 40),
Container(
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.systolicePressure}/${diabtec.diastolicPressure}',
color: Colors.red,
fontSize: 12,
),
),
height: 40),
], ],
), ),
); );
@ -190,4 +111,10 @@ class BloodPressureMonthlyPage extends StatelessWidget {
); );
return tableRow; return tableRow;
} }
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.bloodPressureService.monthDiabtecPatientResult, (obj) => DateUtil.getMonth(obj.bloodPressureDate.month) + ' ' + obj.bloodPressureDate.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
} }

@ -9,15 +9,18 @@ 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:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import "package:collection/collection.dart";
class BloodPressureYearPage extends StatelessWidget { class BloodPressureYearPage extends StatelessWidget {
final BloodPressureViewMode model; final BloodPressureViewMode model;
const BloodPressureYearPage({Key key, this.model}) : super(key: key); BloodPressureYearPage({Key key, this.model}) : super(key: key);
List<List> monthlyGroup = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
@ -51,12 +54,23 @@ class BloodPressureYearPage extends StatelessWidget {
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Column(children: [
border: TableBorder.symmetric( for (var monthly in monthlyGroup)
inside: BorderSide(width: 2.0, color: Colors.grey[300]), Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
), Container(
children: fullData(context, projectViewModel, model), width: double.maxFinite,
), padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(1.8),
2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
SizedBox(height: 80) SizedBox(height: 80)
], ],
), ),
@ -66,139 +80,29 @@ class BloodPressureYearPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) { List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).time),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).arm),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).sysdias),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).measured,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
], ],
), ),
); );
model.yearDiabtecPatientResult.reversed.forEach( model.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue(
child: Container( '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}',
height: 70, isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false),
color: Colors.white, Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false),
child: Center( Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false),
child: Texts(
'${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.measuredArmDesc}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.systolicePressure}/${diabtec.diastolicPressure}',
textAlign: TextAlign.center,
fontSize: 12,
color: Colors.red,
),
),
),
),
], ],
), ),
); );
@ -206,4 +110,10 @@ class BloodPressureYearPage extends StatelessWidget {
); );
return tableRow; return tableRow;
} }
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.bloodPressureService.yearDiabtecPatientResult.reversed, (obj) => DateUtil.getMonth(obj.bloodPressureDate.month) + ' ' + obj.bloodPressureDate.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
} }

@ -10,7 +10,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:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'AddBloodPressurePage.dart'; import 'AddBloodPressurePage.dart';
class BloodPressureWeeklyPage extends StatelessWidget { class BloodPressureWeeklyPage extends StatelessWidget {
@ -48,16 +48,17 @@ class BloodPressureWeeklyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
model.weightWeekTimeSeriesDataTop.isEmpty model.bloodPressureService.weekDiabtecPatientResult.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Table(
border: TableBorder.symmetric( columnWidths: {
inside: BorderSide(width: 2.0, color: Colors.grey[300]), 0: FlexColumnWidth(1.8),
), 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, model), children: fullData(context, projectViewModel, model),
), ),
SizedBox(height: 80) SizedBox(height: 80)
@ -74,85 +75,11 @@ class BloodPressureWeeklyPage extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).time),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).measured),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).value),
borderRadius: BorderRadius.only( Utils.tableColumnTitle(TranslationBase.of(context).edit),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).measured,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).edit,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
], ],
), ),
); );
@ -161,87 +88,47 @@ class BloodPressureWeeklyPage extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue('${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false),
child: Container( Utils.tableColumnValue(diabtec.bloodPressureDate.hour.toString() + ':' + diabtec.bloodPressureDate.minute.toString(), isCapitable: false),
height: 70, Utils.tableColumnValue('${diabtec.measuredArmDesc}', isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false),
color: Colors.white, Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
child: Center( SizedBox(height: 12),
child: Texts( Container(
'${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', child: InkWell(
textAlign: TextAlign.center, onTap: () {
fontSize: 12, Navigator.push(
), context,
), FadePage(
), page: AddBloodPressurePage(
), model: model,
Container( isUpdate: true,
height: 70, lineItemNo: diabtec.lineItemNo,
padding: EdgeInsets.all(10), bloodSugarDate: diabtec.bloodPressureDate,
color: Colors.white, bloodDiastolicValue: diabtec.diastolicPressure.toString(),
child: Center( bloodSystolicValue: diabtec.systolicePressure.toString(),
child: Texts( measureTimeSelectedType: diabtec.measuredArmDesc,
'${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', ),
textAlign: TextAlign.center, ),
fontSize: 12, );
), },
), child: Container(
), // height: 70,
Container( // padding: EdgeInsets.all(10),
child: Container( child: Icon(
height: 70, Icons.edit,
padding: EdgeInsets.all(10), color: Color(0xff575757),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.measuredArmDesc}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.systolicePressure}/${diabtec.diastolicPressure}',
textAlign: TextAlign.center,
fontSize: 12,
color: Colors.red,
),
),
),
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddBloodPressurePage(
model: model,
isUpdate: true,
lineItemNo: diabtec.lineItemNo,
bloodSugarDate: diabtec.bloodPressureDate,
bloodDiastolicValue: diabtec.diastolicPressure.toString(),
bloodSystolicValue: diabtec.systolicePressure.toString(),
measureTimeSelectedType: diabtec.measuredArmDesc,
), ),
), ),
);
},
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Icon(Icons.edit),
), ),
), ),
), SizedBox(height: 6),
Divider(
height: 1,
color: Color(0xffEFEFEF),
thickness: 1,
)
]),
], ],
), ),
); );

@ -14,18 +14,23 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import "package:collection/collection.dart";
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class BloodMonthlyPage extends StatelessWidget { class BloodMonthlyPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales3> timeSeriesData; final List<TimeSeriesSales3> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode; final BloodSugarViewMode bloodSugarViewMode;
const BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key); BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
List<List> monthlyGroup = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold( return AppScaffold(
// baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
body: ListView( body: ListView(
@ -47,166 +52,181 @@ class BloodMonthlyPage extends StatelessWidget {
child: Texts(TranslationBase.of(context).details), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty timeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Column(children: [
border: TableBorder.symmetric( for (var monthly in monthlyGroup)
inside: BorderSide(width: 2.0, color: Colors.grey[300]), Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
), Container(
children: fullData(context, projectViewModel), width: double.maxFinite,
), padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
SizedBox(height: 80) decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
], child: Texts(monthly[0])),
), Table(
) columnWidths: {
0: FlexColumnWidth(1.8),
2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
]))
], ],
), ),
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel) { List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, e) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).time),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).measured),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).value),
borderRadius: BorderRadius.only( // Container(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), // child: Container(
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), // decoration: BoxDecoration(
), // color: Theme.of(context).primaryColor,
), // borderRadius: BorderRadius.only(
child: Center( // topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
child: Texts( // topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
TranslationBase.of(context).date, // ),
color: Colors.white, // ),
fontSize: 15, // child: Center(
), // child: Texts(
), // TranslationBase.of(context).date,
height: 40, // color: Colors.white,
), // fontSize: 15,
), // ),
Container( // ),
child: Container( // height: 40,
decoration: BoxDecoration( // ),
color: Theme.of(context).primaryColor, // ),
), // Container(
child: Center( // child: Container(
child: Texts( // decoration: BoxDecoration(
TranslationBase.of(context).time, // color: Theme.of(context).primaryColor,
color: Colors.white, // ),
fontSize: 15, // child: Center(
), // child: Texts(
), // TranslationBase.of(context).time,
height: 40), // color: Colors.white,
), // fontSize: 15,
Container( // ),
child: Container( // ),
decoration: BoxDecoration( // height: 40),
color: Theme.of(context).primaryColor, // ),
), // Container(
child: Center( // child: Container(
child: Texts( // decoration: BoxDecoration(
TranslationBase.of(context).measured, // color: Theme.of(context).primaryColor,
color: Colors.white, // ),
fontSize: 15, // child: Center(
), // child: Texts(
), // TranslationBase.of(context).measured,
height: 40), // color: Colors.white,
), // fontSize: 15,
Container( // ),
child: Container( // ),
decoration: BoxDecoration( // height: 40),
color: Theme.of(context).primaryColor, // ),
borderRadius: BorderRadius.only( // Container(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), // child: Container(
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), // decoration: BoxDecoration(
), // color: Theme.of(context).primaryColor,
), // borderRadius: BorderRadius.only(
child: Center( // topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
child: Texts( // topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
TranslationBase.of(context).value, // ),
color: Colors.white, // ),
fontSize: 15, // child: Center(
), // child: Texts(
), // TranslationBase.of(context).value,
height: 40), // color: Colors.white,
), // fontSize: 15,
// ),
// ),
// height: 40),
// ),
], ],
), ),
); );
diabtecPatientResult.forEach( e.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart),
child: Container( isCapitable: false),
height: 70, Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false),
color: Colors.white, Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false),
child: Center( // Container(
child: Texts( // child: Container(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', // height: 70,
textAlign: TextAlign.center, // padding: EdgeInsets.all(10),
fontSize: 12, // color: Colors.white,
), // child: Center(
), // child: Texts(
), // '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
), // textAlign: TextAlign.center,
Container( // fontSize: 12,
child: Container( // ),
height: 70, // ),
padding: EdgeInsets.all(10), // ),
color: Colors.white, // ),
child: Center( // Container(
child: Texts( // child: Container(
'${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', // height: 70,
textAlign: TextAlign.center, // padding: EdgeInsets.all(10),
fontSize: 12, // color: Colors.white,
), // child: Center(
), // child: Texts(
), // '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}',
), // textAlign: TextAlign.center,
Container( // fontSize: 12,
child: Container( // ),
height: 70, // ),
padding: EdgeInsets.all(10), // ),
color: Colors.white, // ),
child: Center( // Container(
child: Texts( // child: Container(
'${diabtec.measuredDesc}', // height: 70,
textAlign: TextAlign.center, // padding: EdgeInsets.all(10),
fontSize: 12, // color: Colors.white,
), // child: Center(
), // child: Texts(
), // '${diabtec.measuredDesc}',
), // textAlign: TextAlign.center,
Container( // fontSize: 12,
child: Container( // ),
height: 70, // ),
padding: EdgeInsets.all(10), // ),
color: Colors.white, // ),
child: Center( // Container(
child: Texts( // child: Container(
'${diabtec.resultValue}', // height: 70,
textAlign: TextAlign.center, // padding: EdgeInsets.all(10),
fontSize: 12, // color: Colors.white,
), // child: Center(
), // child: Texts(
), // '${diabtec.resultValue}',
), // textAlign: TextAlign.center,
// fontSize: 12,
// ),
// ),
// ),
// ),
], ],
), ),
); );
@ -214,4 +234,10 @@ class BloodMonthlyPage extends StatelessWidget {
); );
return tableRow; return tableRow;
} }
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(diabtecPatientResult, (obj) => DateUtil.getMonth(obj.dateChart.month) + ' ' + obj.dateChart.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
} }

@ -13,16 +13,19 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import "package:collection/collection.dart";
class BloodYearPage extends StatelessWidget { class BloodYearPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales2> timeSeriesData; final List<TimeSeriesSales2> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode; final BloodSugarViewMode bloodSugarViewMode;
const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key); BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
List<List> yearlyGroup = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
groupData();
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
// baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
@ -56,12 +59,23 @@ class BloodYearPage extends StatelessWidget {
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Column(children: [
border: TableBorder.symmetric( for (var monthly in yearlyGroup)
inside: BorderSide(width: 2.0, color: Colors.grey[300]), Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
), Container(
children: fullData(context, projectViewModel), width: double.maxFinite,
), padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(1.8),
2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
SizedBox(height: 80) SizedBox(height: 80)
], ],
), ),
@ -71,140 +85,28 @@ class BloodYearPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel) { List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, yearlyGroup) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).time),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).measured),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).value),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).measured,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
], ],
), ),
); );
diabtecPatientResult.forEach( yearlyGroup.forEach(
(diabtec) { (diabtec) {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart),
child: Container( isCapitable: false),
height: 70, Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false),
color: Colors.white, Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false),
child: Center(
child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.dateChart.hour}:${diabtec.dateChart.minute}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.measuredDesc}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.resultValue}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
], ],
), ),
); );
@ -212,4 +114,10 @@ class BloodYearPage extends StatelessWidget {
); );
return tableRow; return tableRow;
} }
groupData() {
yearlyGroup.clear();
var groupedArray = groupBy(diabtecPatientResult.reversed, (obj) => DateUtil.getMonth(obj.dateChart.month) + ' ' + obj.dateChart.year.toString());
groupedArray.entries.forEach((e) => yearlyGroup.add([e.key, e.value]));
}
} }

@ -85,26 +85,33 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTick
) )
], ],
), ),
floatingActionButton: InkWell( floatingActionButton: Stack(
onTap: () { children: [
Navigator.push( Positioned(
context, bottom: 80,
FadePage( right: 0,
page: AddBloodSugarPage( child: InkWell(
bloodSugarViewMode: model, onTap: () {
))); Navigator.push(
}, context,
child: Container( FadePage(
width: 55, page: AddBloodSugarPage(
height: 55, bloodSugarViewMode: model,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), )));
child: Center( },
child: Icon( child: Container(
Icons.add, width: 50,
color: Colors.white, height: 50,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
)),
), ),
), ),
), ],
), ),
bottomSheet: Container( bottomSheet: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,

@ -14,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'AddBloodSugarPage.dart'; import 'AddBloodSugarPage.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class BloodSugarWeeklyPage extends StatelessWidget { class BloodSugarWeeklyPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
@ -58,9 +59,10 @@ class BloodSugarWeeklyPage extends StatelessWidget {
), ),
) )
: Table( : Table(
border: TableBorder.symmetric( columnWidths: {
inside: BorderSide(width: 2.0, color: Colors.grey[300]), 0: FlexColumnWidth(1.8),
), 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, bloodSugarViewMode), children: fullData(context, projectViewModel, bloodSugarViewMode),
), ),
SizedBox( SizedBox(
@ -79,85 +81,11 @@ class BloodSugarWeeklyPage extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).date),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).time),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).measured),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).value),
borderRadius: BorderRadius.only( Utils.tableColumnTitle(TranslationBase.of(context).edit),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
),
height: 40,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).measured,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).edit,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
], ],
), ),
); );
@ -166,90 +94,48 @@ class BloodSugarWeeklyPage extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart),
child: Container( isCapitable: false),
height: 70, Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false),
padding: EdgeInsets.all(10), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false),
color: Colors.white, Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false),
child: Center( Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
child: Texts( SizedBox(height: 12),
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', Container(
textAlign: TextAlign.center, child: InkWell(
fontSize: 12, onTap: () {
), Navigator.push(
), context,
), FadePage(
), page: AddBloodSugarPage(
Container( isUpdate: true,
child: Container( bloodSugarDate: diabtec.dateChart,
height: 70, measuredTime: diabtec.measuredDesc,
padding: EdgeInsets.all(10), bloodSugarValue: diabtec.resultValue.toString(),
color: Colors.white, lineItemNo: diabtec.lineItemNo,
child: Center( measureUnitSelectedType: diabtec.unit,
child: Texts( bloodSugarViewMode: bloodSugarViewMode,
'${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', ),
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.measuredDesc}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${diabtec.resultValue}',
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
Container(
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddBloodSugarPage(
isUpdate: true,
bloodSugarDate: diabtec.dateChart,
measuredTime: diabtec.measuredDesc,
bloodSugarValue: diabtec.resultValue.toString(),
lineItemNo: diabtec.lineItemNo,
measureUnitSelectedType: diabtec.unit,
bloodSugarViewMode: bloodSugarViewMode,
), ),
);
},
child: Container(
// height: 70,
// padding: EdgeInsets.all(10),
child: Icon(
Icons.edit,
color: Color(0xff575757),
), ),
);
},
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Icon(Icons.edit),
), ),
), ),
), ),
), SizedBox(height: 6),
Divider(
height: 1,
color: Color(0xffEFEFEF),
thickness: 1,
)
]),
], ],
), ),
); );

Loading…
Cancel
Save