diff --git a/Runner 2021-01-01 21-59-41/DiplomaticQuarter.ipa b/Runner 2021-01-01 21-59-41/DiplomaticQuarter.ipa new file mode 100644 index 00000000..ca720a76 Binary files /dev/null and b/Runner 2021-01-01 21-59-41/DiplomaticQuarter.ipa differ diff --git a/lib/config/config.dart b/lib/config/config.dart index c27fe938..75a904ea 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; const MAX_SMALL_SCREEN = 660; // PACKAGES and OFFERS -const EXA_CART_API_BASE_URL = 'http://10.200.101.75:9000'; +const EXA_CART_API_BASE_URL = 'http://10.50.100.217:1010/offersdiscounts'; // http://10.200.101.75:9000 const PACKAGES_CATEGORIES = '/api/categories'; const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; @@ -16,12 +16,12 @@ const PACKAGES_ORDERS = '/api/orders'; const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -const PHARMACY_BASE_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/'; // // Pharmacy Production URLs -// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -// const PHARMACY_BASE_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 PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; @@ -441,11 +441,13 @@ const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/ // HHC RC SERVICES const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc"; const ADD_HHC_ORDER_RC = "rc/api/HHC/add"; +const GET_ALL_HHC_ORDERS_RC = 'rc/api/hhc/list'; // CMC RC SERVICES const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc'; const ADD_CMC_ORDER_RC = 'rc/api/cmc/add'; const GET_ALL_CMC_ORDERS_RC = 'rc/api/cmc/list'; +const UPDATE_CMC_ORDER_RC = 'rc/api/cmc/update'; // RRT RC SERVICES const ADD_RRT_ORDER_RC = "rc/api/rrt/add"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f69c3f68..bb910f6c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1368,7 +1368,7 @@ const Map localizedValues = { "ar": "تتيح لك هذه الخدمة إجراء استشارة عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت" }, "my-invoice": {"en": "List", "ar": "فواتيري"}, - "invoice-list": {"en": "My Invoice", "ar": "فائمة"}, + "invoice-list": {"en": "My Invoice", "ar": "قائمة"}, "thisItemIsNotAvailable": {"en": "This item is not available", "ar": "هذا العنصر غير متوفر"}, "beforeAfterImages": {"en": "Before & After Images", "ar": "الصور قبل وبعد"}, "clinic-accept-livecare": { diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart index 6e7638f9..341d9e52 100644 --- a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart @@ -5,8 +5,8 @@ class GetCMCAllOrdersResponseModel { bool isOutPatient; int projectId; int nearestProjectId; - double longitude; - double latitude; + dynamic longitude; + dynamic latitude; dynamic appointmentNo; dynamic dischargeId; int statusId; @@ -27,7 +27,7 @@ class GetCMCAllOrdersResponseModel { dynamic paymentStatusText; String projectName; String nearestProjectName; - int paymentAmount; + dynamic paymentAmount; WFOrder wFOrder; String serviceText; bool isSentForApproval; @@ -43,8 +43,7 @@ class GetCMCAllOrdersResponseModel { dynamic approvalStatus; bool isActive; int clickButton; - Null orderHistory; - List procedures; + List procedures; dynamic pickupLocation; dynamic dropOffLocation; dynamic clinicName; @@ -98,7 +97,6 @@ class GetCMCAllOrdersResponseModel { this.approvalStatus, this.isActive, this.clickButton, - this.orderHistory, this.procedures, this.pickupLocation, this.dropOffLocation, @@ -157,7 +155,6 @@ class GetCMCAllOrdersResponseModel { approvalStatus = json['ApprovalStatus']; isActive = json['isActive']; clickButton = json['ClickButton']; - orderHistory = json['OrderHistory']; pickupLocation = json['PickupLocation']; dropOffLocation = json['DropOffLocation']; clinicName = json['clinicName']; @@ -218,7 +215,6 @@ class GetCMCAllOrdersResponseModel { data['ApprovalStatus'] = this.approvalStatus; data['isActive'] = this.isActive; data['ClickButton'] = this.clickButton; - data['OrderHistory'] = this.orderHistory; data['PickupLocation'] = this.pickupLocation; data['DropOffLocation'] = this.dropOffLocation; data['clinicName'] = this.clinicName; @@ -234,7 +230,7 @@ class Orderpayment { int iD; int orderId; dynamic clientRequestId; - int totalAmount; + dynamic totalAmount; int paymentStatus; dynamic order; String created; diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart index 3b0ef151..68be644d 100644 --- a/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart @@ -71,7 +71,8 @@ class UpdatePresOrderRequestModel { data['TokenID'] = this.tokenID; data['PatientTypeID'] = this.patientTypeID; data['PatientType'] = this.patientType; - data['PresOrderID'] = this.presOrderID; + data['Id'] = this.presOrderID; + data['ClickButton'] = 14; data['PresOrderStatus'] = this.presOrderStatus; data['EditedBy'] = this.editedBy; data['RejectionReason'] = this.rejectionReason; diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index 53686715..7fc23cc9 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; @@ -56,14 +55,9 @@ class CMCService extends BaseService { await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { cmcAllPresOrdersList.clear(); cmcAllOrderDetail.clear(); - response['response'].forEach((data) { if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) cmcAllPresOrdersList.add(GetCMCAllOrdersResponseModel.fromJson(data)); }); - - // response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - // if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) cmcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data)); - // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -77,6 +71,10 @@ class CMCService extends BaseService { cmcAllPresOrdersList.clear(); cmcAllOrderDetail.clear(); + response['response'].forEach((data) { + cmcAllPresOrdersList.add(GetCMCAllOrdersResponseModel.fromJson(data)); + }); + // response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { // if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) cmcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data)); // }); @@ -122,12 +120,22 @@ class CMCService extends BaseService { }, body: updatePresOrderRequestModel.toJson()); } + Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + hasError = false; + await baseAppClient.post(UPDATE_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); + } + Future insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async { hasError = false; String reqId = ""; await baseAppClient.post(ADD_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { isOrderUpdated = true; - reqId = response['RequestNo'].toString(); + reqId = response['response'].toString(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index 9643a773..00d44f6a 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; @@ -13,7 +14,7 @@ import '../base_service.dart'; class HomeHealthCareService extends BaseService { List hhcAllServicesList = List(); - List hhcAllPresOrdersList = List(); + List hhcAllPresOrdersList = List(); List hhcAllOrderDetail = List(); List addressesList = List(); @@ -48,14 +49,29 @@ class HomeHealthCareService extends BaseService { }, body: hHCGetAllServicesRequestModel.toJson()); } + Future getHHCAllPresOrdersRC() async { + GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); + hasError = false; + await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { + hhcAllPresOrdersList.clear(); + hhcAllOrderDetail.clear(); + response['response'].forEach((data) { + hhcAllPresOrdersList.add(GetCMCAllOrdersResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getHHCAllPresOrdersRequestModel.toJson()); + } + Future getHHCAllPresOrders() async { GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); hasError = false; await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD, onSuccess: (dynamic response, int statusCode) { hhcAllPresOrdersList.clear(); - response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService()) hhcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data)); - }); + // response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { + // if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService()) hhcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index e779d88a..0dd5c750 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -114,6 +114,9 @@ class BaseAppClient { } } + // body['PatientID'] = 1018977; + // body['TokenID'] = "@dm!n"; + print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 37c0c7be..67ebc641 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -83,9 +83,24 @@ class FeedbackService extends BaseService { Future searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async { hasError = false; Map body = new Map(); - body['IdentificationNo'] = idNumber; + if (type == 1) { + body['IdentificationNo'] = 0; + body['PatientID'] = num.tryParse(idNumber); + body['ItemID'] = 0; + } else if (type == 2) { + body['IdentificationNo'] = idNumber; + body['PatientID'] = 0; + body['ItemID'] = 0; + } else { + body['IdentificationNo'] = 0; + body['PatientID'] = 0; + body['ItemID'] = idNumber; + } + + body['PatientOutSA'] = countryCode.contains("966") ? 0 : 1; + body['MobileNo'] = countryCode + Utils.getPhoneNumberWithoutZero(phoneNumber); - body['Searching_type'] = "$type"; + body['Searching_type'] = type; if (BASE_URL.contains('uat')) { body['ForDemo'] = true; } diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index 375df83d..10edbeb8 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -67,7 +67,7 @@ class CMCViewModel extends BaseViewModel { } else { pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere((element) => element.statusId == 1 || element.statusId == 2, orElse: () => null); if (pendingOrder != null) { - await getOrderDetailByOrderID(pendingOrder); + // await getOrderDetailByOrderID(pendingOrder); setState(ViewState.Idle); } else { getCMCAllServices(); @@ -77,7 +77,8 @@ class CMCViewModel extends BaseViewModel { Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { setState(ViewState.BusyLocal); - await _cMCService.updateCmcPresOrder(updatePresOrderRequestModel); + // await _cMCService.updateCmcPresOrder(updatePresOrderRequestModel); + await _cMCService.updateCmcPresOrderRC(updatePresOrderRequestModel); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 7e45dc92..d27827e4 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; @@ -24,7 +25,7 @@ class HomeHealthCareViewModel extends BaseViewModel { List get addressesList => _customerAddressesService.addressesList; - List get hhcAllPresOrders => _homeHealthCareService.hhcAllPresOrdersList; + List get hhcAllPresOrders => _homeHealthCareService.hhcAllPresOrdersList; List get hhcAllOrderDetail => _homeHealthCareService.hhcAllOrderDetail; @@ -33,7 +34,7 @@ class HomeHealthCareViewModel extends BaseViewModel { bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; int get orderId => _homeHealthCareService.requestNo; - GetHHCAllPresOrdersResponseModel pendingOrder; + GetCMCAllOrdersResponseModel pendingOrder; List patientERHHCInsertServicesList = List(); dynamic get hhcResponse => _homeHealthCareService.hhcResponse; @@ -53,14 +54,14 @@ class HomeHealthCareViewModel extends BaseViewModel { Future getHHCAllPresOrders() async { pendingOrder = null; setState(ViewState.Busy); - await _homeHealthCareService.getHHCAllPresOrders(); + await _homeHealthCareService.getHHCAllPresOrdersRC(); if (_homeHealthCareService.hasError) { error = _homeHealthCareService.error; setState(ViewState.Error); } else { - pendingOrder = _homeHealthCareService.hhcAllPresOrdersList.firstWhere((element) => element.status == 1 || element.status == 2, orElse: () => null); + pendingOrder = _homeHealthCareService.hhcAllPresOrdersList.firstWhere((element) => element.statusId == 1 || element.statusId == 2, orElse: () => null); if (pendingOrder != null) { - await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); + // await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); setState(ViewState.Idle); } else { getHHCAllServices(); diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart index 3d772095..548f4b62 100644 --- a/lib/core/viewModels/medical/blood_pressure_view_model.dart +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -39,9 +39,10 @@ class BloodPressureViewMode extends BaseViewModel { }); 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())); + // weighMonthTimeSeriesDataTop.add(TimeSeriesSales3("Week " + (index + 1).toString(), bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble())); + // weighMonthTimeSeriesDataLow.add(TimeSeriesSales3("Week " + (index + 1).toString(), bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble())); + weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(bloodPressureService.monthDiabtectResultAverageList[index].weekDesc, bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble())); + weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(bloodPressureService.monthDiabtectResultAverageList[index].weekDesc, bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble())); } bloodPressureService.yearDiabtecResultAverageList.forEach((element) { diff --git a/lib/main.dart b/lib/main.dart index bcad3f5f..71420951 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ -import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; +import 'dart:io'; + import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/routes.dart'; @@ -14,6 +15,7 @@ import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:in_app_update/in_app_update.dart'; import 'package:provider/provider.dart'; import 'config/size_config.dart'; @@ -36,12 +38,27 @@ class MyApp extends StatefulWidget { } class _MyApp extends State { + AppUpdateInfo _updateInfo; + + Future checkForUpdate() async { + InAppUpdate.checkForUpdate().then((info) { + if (info.updateAvailable) { + InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); + } + }).catchError((e) { + print(e.toString()); + }); + } + @override void initState() { // ProjectViewModel projectProvider; // projectProvider = Provider.of(context); // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; + // Re-enable once going live + // if (Platform.isAndroid) checkForUpdate(); + ThemeNotifier(defaultTheme()); super.initState(); } @@ -83,16 +100,14 @@ class _MyApp extends State { value: RobotProvider().intStream(), initialData: RobotProvider().setValue({}), ), - ChangeNotifierProvider( - create: (context) => CompareList()), - ChangeNotifierProvider( - create: (context) => OrderPreviewViewModel()), + ChangeNotifierProvider(create: (context) => CompareList()), + ChangeNotifierProvider(create: (context) => OrderPreviewViewModel()), ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( - navigatorObservers: [ - GAnalytics.shared.navObserver() - ], + // navigatorObservers: [ + // GAnalytics.shared.navObserver() + // ], navigatorKey: locator().navigatorKey, showSemanticsDebugger: false, title: 'Diplomatic Quarter App', diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index bd698361..5ef5089c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; @@ -11,7 +12,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:provider/provider.dart'; @@ -85,13 +86,13 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { _context = context; ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage(CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { + void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) { showDialog( context: context, - child: ConfirmCancelOrderDialog( - model: model, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).cancelOrderMsg, onTap: () async { - UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3); + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); Future.delayed(new Duration(milliseconds: 300)).then((value) async { GifLoaderDialogUtils.showMyDialog(_context); await model.updateCmcPresOrder(updatePresOrderRequestModel); @@ -108,11 +109,27 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { )); } - // ' ' + + int status = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusId : 0; + String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusText : ""; + Color _color; + if (status == 1) { + //pending + _color = Color(0xffCC9B14); + } else if (status == 2) { + //processing + _color = Color(0xff2E303A); + } else if (status == 3) { + //completed + _color = Color(0xff359846); + } else if (status == 4 || status == 6 || status == 7) { + //cancel // Rejected + _color = Color(0xffD02127); + } + return Scaffold( body: SafeArea( child: Container( - child: widget.model.cmcAllOrderDetail.length != 0 && widget.model.pendingOrder != null + child: widget.model.pendingOrder != null ? Column( children: [ Container( @@ -124,21 +141,21 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { clipBehavior: Clip.antiAlias, child: Container( // decoration: containerColorRadiusLeft(Colors.white, 12), - margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), - padding: EdgeInsets.all(12), - // color: Colors.white, + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), + padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), decoration: BoxDecoration( - shape: BoxShape.rectangle, color: Colors.white, + border: Border.all(color: Colors.white, width: 1), borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), - topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, - bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), - bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, + bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), ), ), // clipBehavior: Clip.antiAlias, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Column( @@ -146,69 +163,82 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - // TranslationBase.of(context).OrderStatus + - widget.model.pendingOrder.statusText, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - color: Color(0xffcd9e1b), - fontWeight: FontWeight.w700, - ), + _statusDisp, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), ), - mHeight(12), + SizedBox(height: 6), Text( - TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(), - style: TextStyle( - fontSize: 16, - letterSpacing: -0.48, - fontWeight: FontWeight.w700, - ), + '${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD}', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), - Text( - TranslationBase.of(context).serviceName, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w500, - ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).hospital + ": ", + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + Expanded( + child: Text( + // !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), + widget.model.pendingOrder.projectName.trim().toString(), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + ), + ), + ], ), - Text( - !projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].description.toString() : widget.model.cmcAllOrderDetail[0].descriptionN.toString(), - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w700, - ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).serviceName + ": ", + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + Expanded( + child: Text( + widget.model.pendingOrder.serviceText.trim().toString(), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + ), + ), + ], ), ], ), ), Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w700, - ), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), - mHeight(8), - SecondaryButton( - onTap: () { - showConfirmMessage(widget.model, widget.model.cmcAllOrderDetail[0]); - }, - label: TranslationBase.of(context).cancel, - color: Colors.red[900], - small: true, - ) + SizedBox(height: 12), + if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2) + InkWell( + onTap: () { + showConfirmMessage(widget.model, widget.model.pendingOrder); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: Color(0xffD02127), + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(10), + ), + child: Text( + TranslationBase.of(context).cancel_nocaps, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ), + ), + ), ], ), ], ), ), ), - ), + ) ], ) : Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index a7c12e2d..a5c89c17 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -104,7 +104,7 @@ class OrdersLogDetailsPage extends StatelessWidget { } else if (status == 3) { //completed _color = Color(0xff359846); - } else if (status == 4) { + } else if (status == 4 || status == 6 || status == 7) { //cancel // Rejected _color = Color(0xffD02127); } @@ -178,7 +178,7 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.created)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 9797c384..6123a7da 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -44,57 +44,58 @@ class _NewHomeHealthCareStepOnePageState extends State Divider( - height: 1, - color: Color(0xffE5E5E5), - ), - itemCount: widget.model.hhcAllServicesList.length), + ], + ), + ); + }, + separatorBuilder: (context, index) => Divider( + height: 1, + color: Color(0xffE5E5E5), + ), + itemCount: widget.model.hhcAllServicesList.length), + ), Container( color: Colors.white, padding: EdgeInsets.only(top: 0, bottom: 16, right: 21, left: 21), - margin: EdgeInsets.only(top: 50.0), + margin: EdgeInsets.only(bottom: 50.0), child: DefaultButton( TranslationBase.of(context).next, (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index 4a2234c6..c4e82766 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -147,7 +147,7 @@ class _NewHomeHealthCarePageState extends State with Tick crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description), + widget.model.pendingOrder.statusText, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 6), @@ -188,11 +188,11 @@ class _NewHomeHealthCarePageState extends State with Tick crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (widget.model.pendingOrder.status == 1 || widget.model.pendingOrder.status == 2) + if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2) InkWell( onTap: () { showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 948ee8d6..b474ec42 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; @@ -24,7 +25,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { + void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) { showDialog( context: context, child: ConfirmWithMessageDialog( @@ -75,10 +76,10 @@ class OrdersLogDetailsPage extends StatelessWidget { padding: EdgeInsets.all(21), physics: BouncingScrollPhysics(), itemBuilder: (context, index) { - GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index]; + GetCMCAllOrdersResponseModel order = model.hhcAllPresOrders[index]; - int status = order.status; - String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; + int status = order.statusId; + String _statusDisp = order.statusText; Color _color; if (status == 1) { //pending @@ -148,7 +149,7 @@ class OrdersLogDetailsPage extends StatelessWidget { ), Expanded( child: Text( - !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), + order.nearestProjectName.trim().toString(), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -162,11 +163,11 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (order.status == 1 || order.status == 2) + if (order.statusId == 1 || order.statusId == 2) InkWell( onTap: () { showConfirmMessage(model, order); diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 583dabbf..fe385ade 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -224,7 +224,7 @@ class _TodayPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).amount, + TranslationBase.of(context).amount_, style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index e813e9df..e567dbe7 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -321,7 +321,7 @@ class _CovidPaymentDetailsState extends State { cancel(); }, child: Text( - TranslationBase.of(context).cancel, + TranslationBase.of(context).cancel_nocaps, style: TextStyle( fontSize: 16.0, letterSpacing: -0.48, diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index dd3b0267..18450954 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -85,18 +85,14 @@ class _MyFamily extends State with TickerProviderStateMixin { projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase - .of(context) - .myFamilyFiles, + appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, showNewAppBar: true, showNewAppBarTitle: true, onTap: widget.isAppbarVisible == false ? widget.onBackClick : null, icon: "assets/images/new/bottom_nav/family_files.svg", - description: TranslationBase - .of(context) - .familyInfo, + description: TranslationBase.of(context).familyInfo, body: Column( children: [ TabBar( @@ -118,35 +114,26 @@ class _MyFamily extends State with TickerProviderStateMixin { fontWeight: FontWeight.w600, letterSpacing: -0.48, ), - tabs: [Text(TranslationBase - .of(context) - .family), Text(TranslationBase - .of(context) - .request) - ], + tabs: [Text(TranslationBase.of(context).family), Text(TranslationBase.of(context).request)], ), Expanded( child: (user != null && projectViewModel.isLogin) ? TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [myFamilyDetails(context), myFamilyRequest(context)], - ) + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [myFamilyDetails(context), myFamilyRequest(context)], + ) : Container(child: AppText('')), ), ], ), bottomSheet: Container( - color: Theme - .of(context) - .scaffoldBackgroundColor, + color: Theme.of(context).scaffoldBackgroundColor, width: double.infinity, padding: EdgeInsets.all(14), child: DefaultButton( - TranslationBase - .of(context) - .addFamilyMember, - () async { + TranslationBase.of(context).addFamilyMember, + () async { Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE); }, ), @@ -169,25 +156,21 @@ class _MyFamily extends State with TickerProviderStateMixin { return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading...')); default: if (snapshot.hasError) - return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase - .of(context) - .noDataAvailable)); + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); else return ListView.separated( itemBuilder: (context, index) { - snapshot.data.getAllSharedRecordsByStatusList[index].gender = 2; if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) return Container( margin: EdgeInsets.all(5), - decoration: cardRadius(15, elevation: 0, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0xffFDA4B0) : Color(0xff6EA8FF),), - - + decoration: cardRadius( + 15, + elevation: 0, + color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF), + ), child: Container( - // height: 130,0xffFDA4B0 - width: MediaQuery - .of(context) - .size - .width, + // height: 130,0xffFDA4B0 + width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -196,23 +179,17 @@ class _MyFamily extends State with TickerProviderStateMixin { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - snapshot.data.getAllSharedRecordsByStatusList[index].patientName - .toLowerCase() - .capitalizeFirstofEach, - fontSize: 22, + snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach, + fontSize: 18, fontWeight: FontWeight.bold, color: Colors.white, ), - Texts(TranslationBase - .of(context) - .fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(), + Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(), fontSize: 12, color: Colors.white), Texts( snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() + ' ' + - TranslationBase - .of(context) - .years + + TranslationBase.of(context).years + ', ' + snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription, fontSize: 12, @@ -233,7 +210,7 @@ class _MyFamily extends State with TickerProviderStateMixin { mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset("assets/images/new-design/switch.svg", - height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0Xff5A282E) : Colors.white), + height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white), SizedBox( width: 5, ), @@ -246,10 +223,8 @@ class _MyFamily extends State with TickerProviderStateMixin { // if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); // }, // ), - Texts(TranslationBase - .of(context) - .switchUser, - color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0Xff5A282E) : Colors.white, + Texts(TranslationBase.of(context).switchUser, + color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white, fontSize: 12, fontWeight: FontWeight.w600) ], @@ -268,14 +243,12 @@ class _MyFamily extends State with TickerProviderStateMixin { mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset("assets/images/new-design/delete.svg", - height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0Xff5A282E) : Colors.white), + height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white), SizedBox( width: 5, ), - Texts(TranslationBase - .of(context) - .delete, - color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0Xff5A282E) : Colors.white, + Texts(TranslationBase.of(context).delete, + color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white, fontSize: 12, fontWeight: FontWeight.w600), ], @@ -302,406 +275,373 @@ class _MyFamily extends State with TickerProviderStateMixin { } int checkActive(List list) { - return list - .where((o) => o.status == 3) - .toList() - .length; + return list.where((o) => o.status == 3).toList().length; } Widget myFamilyRequest(context) { return //Padding( - // padding: const EdgeInsets.symmetric(horizontal: 10.0), - // child: - SingleChildScrollView( - child: Container( - height: MediaQuery - .of(context) - .size - .height, - margin: EdgeInsets.only(top: 10), - child: Column( - children: [ - FractionallySizedBox( - widthFactor: 1.0, - child: AppExpandableNotifier( - title: TranslationBase - .of(context) - .userViewRequest, - bodyWidget: FutureBuilder( - future: getUserViewRequest(), // async work - builder: (BuildContext context, AsyncSnapshot snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return SizedBox(); - - default: - if (snapshot.hasError) - return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase - .of(context) - .noDataAvailable)); - else - return ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), - itemBuilder: (context, _index) { - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + // padding: const EdgeInsets.symmetric(horizontal: 10.0), + // child: + SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.only(top: 10), + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 1.0, + child: AppExpandableNotifier( + title: TranslationBase.of(context).userViewRequest, + bodyWidget: FutureBuilder( + future: getUserViewRequest(), // async work + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return SizedBox(); + + default: + if (snapshot.hasError) + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); + else + return ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + itemBuilder: (context, _index) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(width: 1, color: Color(0xffEFEFEF)), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), ), - border: Border.all(width: 1, color: Color(0xffEFEFEF)), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - //spreadRadius: 5, - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - color: Colors.white), - child: Column( - children: [ - Column(children: [ - Padding( - padding: EdgeInsets.all(10), - child: Row(children: [ - Expanded(flex: 3, child: AppText(TranslationBase - .of(context) - .name, fontWeight: FontWeight.w600)), - Expanded(flex: 1, child: AppText(TranslationBase - .of(context) - .allow, fontWeight: FontWeight.w600)), - Expanded(flex: 1, child: AppText(TranslationBase - .of(context) - .reject, fontWeight: FontWeight.w600)), - ])), - Padding( - padding: const EdgeInsets.only(left: 10.0, right: 10.0), - child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), - ), - Column( - children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { - return Container( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Texts( - result.patientName, - fontWeight: FontWeight.w600, - fontSize: 12, - )), - Expanded( - flex: 1, - child: IconButton( - icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22), - onPressed: () { - acceptRemoveRequest(result.iD, 3, context); - }, - )), - Expanded( - flex: 1, - child: IconButton( - icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22), - color: Colors.white, - onPressed: () { - acceptRemoveRequest(result.iD, 4, context); - }, - )) - ], - )); - }).toList()) - ]) ], - )); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: 1); - } - }, - ))), - - // RoundedContainer( - // child: ExpansionTile( - // title: Text( - // TranslationBase.of(context).userViewRequest, - // style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), - // ), - // children: [ - // FutureBuilder( - // future: getUserViewRequest(), // async work - // builder: (BuildContext context, AsyncSnapshot snapshot) { - // switch (snapshot.connectionState) { - // case ConnectionState.waiting: - // return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); - // default: - // if (snapshot.hasError) - // return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); - // else - // return Container( - // padding: EdgeInsets.all(15), - // child: Card( - // elevation: 3, - // shape: cardRadius(8), - // child: Column( - // children: [ - // Column(children: [ - // Padding( - // padding: EdgeInsets.all(10), - // child: Row(children: [ - // Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), - // Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), - // Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), - // ])), - // Divider(color: Colors.black, height: 1.5, thickness: 1.5), - // Column( - // children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { - // return Container( - // padding: EdgeInsets.all(10), - // child: Row( - // children: [ - // Expanded( - // flex: 3, - // child: Texts( - // result.patientName, - // fontWeight: FontWeight.w600, - // fontSize: 12, - // )), - // Expanded( - // flex: 1, - // child: IconButton( - // icon: Icon( - // Icons.check_circle, - // color: Color(0xff349745), - // ), - // onPressed: () { - // acceptRemoveRequest(result.iD, 3, context); - // }, - // )), - // Expanded( - // flex: 1, - // child: IconButton( - // icon: Icon( - // Icons.close, - // color: Colors.red[900], - // ), - // onPressed: () { - // acceptRemoveRequest(result.iD, 4, context); - // }, - // )) - // ], - // )); - // }).toList()) - // ]) - // ], - // ))); - // } - // }) - // ], - // ), - // ), - SizedBox(height: 15), - FractionallySizedBox( - widthFactor: 1.0, - child: AppExpandableNotifier( - title: TranslationBase - .of(context) - .sentRequest, - bodyWidget: FutureBuilder( - future: getSentRequest(), // async work - builder: (BuildContext context, AsyncSnapshot snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return SizedBox(); - default: - if (snapshot.hasError) - return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase - .of(context) - .noDataAvailable)); - else - return ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), - itemBuilder: (context, _index) { - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(width: 1, color: Color(0xffEFEFEF)), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - //spreadRadius: 5, - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - color: Colors.white), - child: Column( - children: [ + color: Colors.white), + child: Column( + children: [ + Column(children: [ Padding( padding: EdgeInsets.all(10), child: Row(children: [ - Expanded(flex: 3, child: AppText(TranslationBase - .of(context) - .name, fontWeight: FontWeight.w600)), - Expanded(flex: 1, child: AppText(TranslationBase - .of(context) - .status, fontWeight: FontWeight.w600)) + Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), + Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), + Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), ])), Padding( padding: const EdgeInsets.only(left: 10.0, right: 10.0), child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), ), Column( - children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Texts( - result.patientName, - fontWeight: FontWeight.w600, - fontSize: 12, - )), - Expanded( - flex: 1, - child: Container( - decoration: cardRadius(10, color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), elevation: 3,), - child: Padding( - padding: EdgeInsets.all(5), - child: AppText( - result.statusDescription, - color: Colors.white, - textAlign: TextAlign.center, - fontSize: 12, - )))), - ], - )); - }).toList(), - ) - ], - )); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: 1, - ); - } - }))), - SizedBox( - height: 15, - ), - FractionallySizedBox( - widthFactor: 1.0, - child: AppExpandableNotifier( - title: TranslationBase - .of(context) - .userView, - bodyWidget: FutureBuilder( - future: getUserViewRequest(), // async work - builder: (BuildContext context, AsyncSnapshot snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return Padding(padding: EdgeInsets.only(top: 50), child: Text('')); - default: - if (snapshot.hasError) - return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase - .of(context) - .noDataAvailable)); - else - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(width: 1, color: Color(0xffEFEFEF)), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - //spreadRadius: 5, - blurRadius: 27, - offset: Offset(0, -3), - ), + children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { + return Container( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Texts( + result.patientName, + fontWeight: FontWeight.w600, + fontSize: 12, + )), + Expanded( + flex: 1, + child: IconButton( + icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22), + onPressed: () { + acceptRemoveRequest(result.iD, 3, context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22), + color: Colors.white, + onPressed: () { + acceptRemoveRequest(result.iD, 4, context); + }, + )) + ], + )); + }).toList()) + ]) ], - color: Colors.white), - child: Column( - children: [ - Column(children: [ + )); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: 1); + } + }, + ))), + + // RoundedContainer( + // child: ExpansionTile( + // title: Text( + // TranslationBase.of(context).userViewRequest, + // style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), + // ), + // children: [ + // FutureBuilder( + // future: getUserViewRequest(), // async work + // builder: (BuildContext context, AsyncSnapshot snapshot) { + // switch (snapshot.connectionState) { + // case ConnectionState.waiting: + // return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); + // default: + // if (snapshot.hasError) + // return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); + // else + // return Container( + // padding: EdgeInsets.all(15), + // child: Card( + // elevation: 3, + // shape: cardRadius(8), + // child: Column( + // children: [ + // Column(children: [ + // Padding( + // padding: EdgeInsets.all(10), + // child: Row(children: [ + // Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), + // Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), + // Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), + // ])), + // Divider(color: Colors.black, height: 1.5, thickness: 1.5), + // Column( + // children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { + // return Container( + // padding: EdgeInsets.all(10), + // child: Row( + // children: [ + // Expanded( + // flex: 3, + // child: Texts( + // result.patientName, + // fontWeight: FontWeight.w600, + // fontSize: 12, + // )), + // Expanded( + // flex: 1, + // child: IconButton( + // icon: Icon( + // Icons.check_circle, + // color: Color(0xff349745), + // ), + // onPressed: () { + // acceptRemoveRequest(result.iD, 3, context); + // }, + // )), + // Expanded( + // flex: 1, + // child: IconButton( + // icon: Icon( + // Icons.close, + // color: Colors.red[900], + // ), + // onPressed: () { + // acceptRemoveRequest(result.iD, 4, context); + // }, + // )) + // ], + // )); + // }).toList()) + // ]) + // ], + // ))); + // } + // }) + // ], + // ), + // ), + SizedBox(height: 15), + FractionallySizedBox( + widthFactor: 1.0, + child: AppExpandableNotifier( + title: TranslationBase.of(context).sentRequest, + bodyWidget: FutureBuilder( + future: getSentRequest(), // async work + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return SizedBox(); + default: + if (snapshot.hasError) + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); + else + return ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + itemBuilder: (context, _index) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(width: 1, color: Color(0xffEFEFEF)), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Column( + children: [ Padding( padding: EdgeInsets.all(10), child: Row(children: [ - Expanded( - flex: 3, - child: AppText( - TranslationBase - .of(context) - .name, - fontWeight: FontWeight.w600, - )), - Expanded( - flex: 1, - child: AppText( - TranslationBase - .of(context) - .delete, - fontWeight: FontWeight.w600, - textAlign: TextAlign.center, - )), + Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), + Expanded(flex: 1, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600)) ])), Padding( padding: const EdgeInsets.only(left: 10.0, right: 10.0), child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), ), Column( - children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Texts( - result.patientName, - fontWeight: FontWeight.w600, - fontSize: 12, - )), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.red, - ), - onPressed: () { - deactivateRequest(result.iD, 5, context); - }, - )), - ], - )); - }).toList()) - ]) + children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Texts( + result.patientName, + fontWeight: FontWeight.w600, + fontSize: 12, + )), + Expanded( + flex: 1, + child: Card( + // shape: cardRadius(10), + color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), + child: Padding( + padding: EdgeInsets.all(5), + child: AppText( + result.statusDescription, + color: Colors.white, + textAlign: TextAlign.center, + fontSize: 12, + )))), + ], + )); + }).toList(), + ) + ], + )); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: 1, + ); + } + }))), + SizedBox( + height: 15, + ), + FractionallySizedBox( + widthFactor: 1.0, + child: AppExpandableNotifier( + title: TranslationBase.of(context).userView, + bodyWidget: FutureBuilder( + future: getUserViewRequest(), // async work + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding(padding: EdgeInsets.only(top: 50), child: Text('')); + default: + if (snapshot.hasError) + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); + else + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(width: 1, color: Color(0xffEFEFEF)), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), ], - )); - } - }))) - ], - ), + color: Colors.white), + child: Column( + children: [ + Column(children: [ + Padding( + padding: EdgeInsets.all(10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context).name, + fontWeight: FontWeight.w600, + )), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).delete, + fontWeight: FontWeight.w600, + textAlign: TextAlign.center, + )), + ])), + Padding( + padding: const EdgeInsets.only(left: 10.0, right: 10.0), + child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), + ), + Column( + children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Texts( + result.patientName, + fontWeight: FontWeight.w600, + fontSize: 12, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.red, + ), + onPressed: () { + deactivateRequest(result.iD, 5, context); + }, + )), + ], + )); + }).toList()) + ]) + ], + )); + } + }))) + ], ), - ); + ), + ); } String isAvailable() { if (isVaiable == false) { this.isVaiable = true; - return TranslationBase - .of(context) - .noDataAvailable; + return TranslationBase.of(context).noDataAvailable; } else { return ""; } @@ -728,15 +668,9 @@ class _MyFamily extends State with TickerProviderStateMixin { deleteFamily(family, context) { ConfirmDialog dialog = new ConfirmDialog( context: context, - confirmMessage: TranslationBase - .of(context) - .removeFamilyMember, - okText: TranslationBase - .of(context) - .confirm, - cancelText: TranslationBase - .of(context) - .cancel_nocaps, + confirmMessage: TranslationBase.of(context).removeFamilyMember, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {ConfirmDialog.closeAlertDialog(context), removeFamily(family, context)}, cancelFunction: () => {}); dialog.showAlertDialog(context); @@ -797,29 +731,26 @@ class _MyFamily extends State with TickerProviderStateMixin { _vitalSignService.heightCm = ""; _vitalSignService.weightKg = ""; await authenticatedUserObject.getUser(getUser: true); - Provider - .of(AppGlobal.context, listen: false) - .user = authenticatedUserObject.user; + Provider.of(AppGlobal.context, listen: false).user = authenticatedUserObject.user; Provider.of(AppGlobal.context, listen: false).setUser(authenticatedUserObject.user); appointmentRateViewModel .getIsLastAppointmentRatedList() - .then((value) => - { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - {Navigator.pushAndRemoveUntil(AppGlobal.context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false)} - }) + .then((value) => { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + {Navigator.pushAndRemoveUntil(AppGlobal.context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false)} + }) .catchError((err) { print(err); // Utils.hideProgressDialog(); diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 5a859fca..7b699467 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notificatio import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -15,25 +16,6 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class NotificationsPage extends StatelessWidget { - getDateForm(String date) { - DateTime d = DateUtil.convertStringToDate(date); - String monthName = DateUtil.getMonth(d.month).toString(); - TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); - String minute = timeOfDay.minute < 10 ? timeOfDay.minute.toString().padLeft(2, '0') : timeOfDay.minute.toString(); - - String hour = '${timeOfDay.hourOfPeriod}:$minute'; - if (timeOfDay.period == DayPeriod.am) { - hour = hour + "AM"; - } else { - { - hour = hour + "PM"; - } - } - - //DayPeriod.am - return monthName + ',${d.day},${d.year}, $hour'; - } - int currentIndex = 0; @override @@ -41,7 +23,11 @@ class NotificationsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { - GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2); + GetNotificationsRequestModel getNotificationsRequestModel = + new GetNotificationsRequestModel( + currentPage: currentIndex, + pagingSize: 14, + notificationStatusID: 2); model.getNotifications(getNotificationsRequestModel, context); }, @@ -53,6 +39,28 @@ class NotificationsPage extends StatelessWidget { baseViewModel: model, body: ListView.separated( itemBuilder: (context, index) { + if (index == model.notifications.length) { + return InkWell( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + currentIndex++; + GetNotificationsRequestModel + getNotificationsRequestModel = + new GetNotificationsRequestModel( + currentPage: currentIndex, + pagingSize: 14, + notificationStatusID: 2); + + await model.getNotifications( + getNotificationsRequestModel, context); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Image.asset('assets/images/notf.png'), + ), + ); + } + return InkWell( onTap: () async { if (!model.notifications[index].isRead) { @@ -69,17 +77,23 @@ class NotificationsPage extends StatelessWidget { width: double.infinity, padding: EdgeInsets.all(8.0), decoration: BoxDecoration( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + color: model.notifications[index].isRead + ? Theme.of(context).scaffoldBackgroundColor + : CustomColors.accentColor.withOpacity(0.05), border: projectViewModel.isArabic ? Border( right: BorderSide( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + color: model.notifications[index].isRead + ? Theme.of(context).scaffoldBackgroundColor + : CustomColors.accentColor, width: 5.0, ), ) : Border( left: BorderSide( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + color: model.notifications[index].isRead + ? Theme.of(context).scaffoldBackgroundColor + : CustomColors.accentColor, width: 5.0, ), ), @@ -92,16 +106,25 @@ class NotificationsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + Texts(DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(model + .notifications[index].createdOn)) + " " + - DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false)), + DateUtil.formatDateToTimeLang( + DateUtil.convertStringToDate(model + .notifications[index].createdOn), + false)), SizedBox( height: 5, ), Row( children: [ - Expanded(child: Texts(model.notifications[index].message)), - if (model.notifications[index].messageType == "image") + Expanded( + child: Texts(model + .notifications[index].message)), + if (model + .notifications[index].messageType == + "image") Icon( FontAwesomeIcons.images, color: CustomColors.grey, @@ -130,7 +153,7 @@ class NotificationsPage extends StatelessWidget { ], ); }, - itemCount: model.notifications.length)), + itemCount: model.notifications.length + 1)), // ListView( // children: model.notifications // .map( diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index b474c3e2..ccee254b 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -65,8 +65,8 @@ class _PaymentMethodState extends State { ), mWidth(12), Container( - height: 60.0, - width: 60, + height: 70.0, + width: 70.0, padding: EdgeInsets.all(7.0), child: Image.asset("assets/images/new/payment/Mada.png"), ), diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index afc00df4..5040b200 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -33,7 +33,11 @@ class _StatusFeedbackPageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getCOC(), + allowAny: true, + onModelReady: (model) { + model.cOCItemList.clear(); + if (projectViewModel.isLogin) model.getCOC(); + }, builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, @@ -160,6 +164,7 @@ class _StatusFeedbackPageState extends State { countryCode = value; }); }), + if (model.cOCItemList.length > 0) listData(model.cOCItemList, projectViewModel.isArabic, false), ], ), ), @@ -178,9 +183,7 @@ class _StatusFeedbackPageState extends State { Future.delayed(Duration(seconds: 1), () { AppToast.showErrorToast(message: model.error); }); - } else { - listData(model.cOCItemList, projectViewModel.isArabic, false); - } + } else {} }); }, disabledColor: Colors.grey, diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index e1a0b843..2d79219d 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -31,7 +31,11 @@ class ConfirmPaymentPage extends StatefulWidget { final String selectedPaymentMethod; AuthenticatedUser authenticatedUser; - ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); + ConfirmPaymentPage( + {this.advanceModel, + this.patientInfoAndMobileNumber, + this.selectedPaymentMethod, + this.authenticatedUser}); @override _ConfirmPaymentPageState createState() => _ConfirmPaymentPageState(); @@ -47,12 +51,16 @@ class _ConfirmPaymentPageState extends State { void submit(MyBalanceViewModel model, code) { final activationCode = code; GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - model.checkActivationCodeForAdvancePayment(activationCode: activationCode).then((value) { + model + .checkActivationCodeForAdvancePayment(activationCode: activationCode) + .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); Navigator.pop(context, true); - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientInfoAndMobileNumber.projectID; - openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); + openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, + double.parse(widget.advanceModel.amount), null); }); } @@ -70,22 +78,6 @@ class _ConfirmPaymentPageState extends State { Navigator.pop(context), }, ).displayDialog(context); - - // showDialog( - // context: context, - // barrierDismissible: false, - // child: ConfirmSMSDialog( - // phoneNumber: patientInfoAndMobileNumber.mobileNumber, - // ), - // ).then((value) { - // print("dialog dismissed"); - // print(value); - // if (value != null && value) { - // AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - // appo.projectID = patientInfoAndMobileNumber.projectID; - // openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), null); - // } - // }); } return BaseView( @@ -120,11 +112,13 @@ class _ConfirmPaymentPageState extends State { Container( height: 100.0, padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)), + width: MediaQuery.of(context).size.width * 0.30, + child: Image.asset( + getImagePath(widget.selectedPaymentMethod)), ), Text( - '${widget.advanceModel.amount} SAR', + '${widget.advanceModel.amount} ' + + TranslationBase.of(context).sar, style: TextStyle( fontSize: 20, fontWeight: FontWeight.w900, @@ -153,7 +147,8 @@ class _ConfirmPaymentPageState extends State { margin: EdgeInsets.all(3), child: NewTextFields( hintText: TranslationBase.of(context).name, - initialValue: widget.patientInfoAndMobileNumber.firstName, + initialValue: + widget.patientInfoAndMobileNumber.firstName, isEnabled: false, ), ), @@ -173,7 +168,11 @@ class _ConfirmPaymentPageState extends State { ), NewTextFields( hintText: TranslationBase.of(context).depositorName, - initialValue: model.user.firstName + " " + model.user.middleName + " " + model.user.lastName, + initialValue: model.user.firstName + + " " + + model.user.middleName + + " " + + model.user.lastName, isEnabled: false, ), SizedBox( @@ -198,9 +197,14 @@ class _ConfirmPaymentPageState extends State { TranslationBase.of(context).confirm.toUpperCase(), () { GifLoaderDialogUtils.showMyDialog(context); - model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { + model + .sendActivationCodeForAdvancePayment( + patientID: int.parse(widget.advanceModel.fileNumber), + projectID: widget.advanceModel.hospitalsModel.iD) + .then((value) { GifLoaderDialogUtils.hideDialog(context); - if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model); + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) showSMSDialog(model); }); }, ), @@ -213,35 +217,54 @@ class _ConfirmPaymentPageState extends State { String getImagePath(String paymentMethod) { switch (paymentMethod) { case "MADA": - return 'assets/images/new-design/mada.png'; + return 'assets/images/new/payment/Mada.png'; break; case "SADAD": return 'assets/images/new-design/sadad.png'; break; case "VISA": - return 'assets/images/new-design/visa.png'; + return 'assets/images/new/payment/visa.png'; break; case "MASTERCARD": - return 'assets/images/new-design/mastercard.png'; + return 'assets/images/new/payment/Mastercard.png'; break; case "Installment": - return 'assets/images/new-design/installment.png'; + return 'assets/images/new/payment/installments.png'; break; case "ApplePay": - return 'assets/images/new-design/applepay.svg'; + return 'assets/images/new/payment/Apple_Pay.png'; break; } return 'assets/images/new-design/mada.png'; } - openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { - browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, + double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber)); + transID = Utils.getAdvancePaymentTransID( + widget.advanceModel.hospitalsModel.iD, + int.parse(widget.advanceModel.fileNumber)); - browser.openPaymentBrowser(amount, "Advance Payment", transID, widget.advanceModel.hospitalsModel.iD.toString(), widget.advanceModel.email, paymentMethod, - widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", ""); + browser.openPaymentBrowser( + amount, + "Advance Payment", + transID, + widget.advanceModel.hospitalsModel.iD.toString(), + widget.advanceModel.email, + paymentMethod, + widget.patientInfoAndMobileNumber.patientType, + widget.advanceModel.patientName, + widget.advanceModel.fileNumber, + authenticatedUser, + browser, + false, + "3", + ""); } onBrowserLoadStart(String url) { @@ -293,11 +316,23 @@ class _ConfirmPaymentPageState extends State { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, - widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) + service.HIS_createAdvancePayment( + appo, + widget.advanceModel.hospitalsModel.iD.toString(), + res['Amount'], + res['Fort_id'], + res['PaymentMethod'], + widget.patientInfoAndMobileNumber.patientType, + widget.advanceModel.patientName, + widget.advanceModel.fileNumber, + AppGlobal.context) .then((res) { print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + 0, + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); @@ -305,9 +340,13 @@ class _ConfirmPaymentPageState extends State { }); } - addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) { + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + dynamic appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, AppGlobal.context) + .then((res) { print(res); GifLoaderDialogUtils.hideDialog(AppGlobal.context); navigateToHome(AppGlobal.context); diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index b555c0d3..b97e118b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart index 9986a42b..8dd26f41 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -27,12 +27,13 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: MonthCurvedChartBloodPressure( + child: + MonthCurvedChartBloodPressure( horizontalInterval: 20.0, title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataTop, timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataLow, - indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, + indexes: model.weighMonthTimeSeriesDataLow.length ~/ 5.5, ), ), SizedBox( @@ -87,7 +88,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Utils.tableColumnTitle(TranslationBase.of(context).date), Utils.tableColumnTitle(TranslationBase.of(context).time), Utils.tableColumnTitle(TranslationBase.of(context).arm), - Utils.tableColumnTitle(TranslationBase.of(context).sysdias), + Utils.tableColumnTitle(TranslationBase.of(context).value), ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart index dc4b2809..893fc468 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -2,6 +2,7 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -28,9 +29,7 @@ class BloodPressureYearPage extends StatelessWidget { Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: CurvedChartBloodPressure( - horizontalInterval: 3.0, - // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, + child: LineChartCurvedBloodPressure( title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataTop, timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataLow, @@ -85,7 +84,7 @@ class BloodPressureYearPage extends StatelessWidget { Utils.tableColumnTitle(TranslationBase.of(context).date), Utils.tableColumnTitle(TranslationBase.of(context).time), Utils.tableColumnTitle(TranslationBase.of(context).arm), - Utils.tableColumnTitle(TranslationBase.of(context).sysdias), + Utils.tableColumnTitle(TranslationBase.of(context).value), ], ), ); diff --git a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart index b2721366..bf3d9cb9 100644 --- a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart +++ b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart @@ -12,8 +12,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { final int indexes; final double horizontalInterval; - MonthCurvedChartBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.horizontalInterval = 20.0}); + MonthCurvedChartBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.horizontalInterval = 20.0}); List xAxixs = List(); List yAxixs = List(); @@ -38,8 +37,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { ), Text( title, - style: TextStyle( - color: Colors.black, fontSize: 15, letterSpacing: 2), + style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2), textAlign: TextAlign.center, ), SizedBox( @@ -47,8 +45,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { ), Expanded( child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -67,9 +64,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), ), SizedBox( width: 5, @@ -85,8 +80,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, color: secondaryColor), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: secondaryColor), ), SizedBox( width: 5, @@ -122,8 +116,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -133,12 +126,17 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { ), margin: 22, getTitles: (value) { - return ''; + return timeSeries1[value.toInt()].time; + // return ''; }, ), leftTitles: SideTitles( showTitles: true, - interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + interval: getMaxY() - getMinY() <= 500 + ? 10 + : getMaxY() - getMinY() <= 1000 + ? 30 + : 40, getTextStyles: (value) => const TextStyle( color: Colors.black, @@ -227,7 +225,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { spots: spots, isCurved: true, colors: [Colors.red], - barWidth: 5, + barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( show: false, @@ -240,7 +238,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { spots: spots2, isCurved: true, colors: [Theme.of(context).primaryColor], - barWidth: 5, + barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( show: false, diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index c9f4e9c6..d23b91b2 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -146,7 +146,7 @@ class Utils { } String loginIDPattern(loginType) { - var length = loginType == 1 ? 10 : 6; + var length = loginType == 1 ? 10 : 4; return "([0-9]{" + length.toString() + "})"; } diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 24d632bc..f897cb27 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -70,7 +70,7 @@ class TimeSeriesSales2 { TimeSeriesSales2(this.time, this.sales); } class TimeSeriesSales3 { - final int time; + final dynamic time; final double sales; TimeSeriesSales3(this.time, this.sales); diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index b23d90f5..86c83f5b 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -137,7 +137,7 @@ class ShowChart extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - interval: null, + interval: _fetchLeftTileInterval(), margin: 12, ), ), @@ -177,6 +177,11 @@ class ShowChart extends StatelessWidget { minY -= increasingY.abs(); } + double _fetchLeftTileInterval() { + final interval = ((lastY - intialY) / 5).toDouble(); + return interval < 1.0 ? 1.0 : interval; + } + double getMaxY() { maxY = 0; timeSeries.forEach((element) { diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index 7b8a0c47..04ed184b 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -46,7 +46,7 @@ class _VitalSignDetailsWidgetState extends State { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime), false), isLast: i == (labOrderResultList.length - 1)), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime)), isLast: i == (labOrderResultList.length - 1)), Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)), ], ), diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 0b96d8fe..6209f52d 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; @@ -35,7 +36,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; + import '../../config/size_config.dart'; import '../../locator.dart'; import 'drawer_item_widget.dart'; @@ -46,10 +47,10 @@ class AppDrawer extends StatefulWidget { } class _AppDrawerState extends State { + @override void initState() { super.initState(); - checkUserData(); } diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index a63ed0be..f4cd18fe 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -229,46 +229,49 @@ class _MobileNo extends State { ), ], ), - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), - child: Row(children: [ - Expanded( - flex: 1, - child: Icon( - Icons.phone, - color: secondaryColor, + Directionality( + textDirection: TextDirection.ltr, + child: Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), + child: Row(children: [ + Expanded( + flex: 1, + child: Icon( + Icons.phone, + color: secondaryColor, + ), ), - ), - Expanded( - flex: 1, - child: Text( - countryCode, - overflow: TextOverflow.clip, + Expanded( + flex: 1, + child: Text( + countryCode, + overflow: TextOverflow.clip, + ), ), - ), - Expanded( - flex: 4, - child: Container( - margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), - child: TextField( - controller: widget.controller, - keyboardType: TextInputType.number, - maxLength: 10, - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp("[0-9]")), - ], - // maxLengthEnforced: true, - // onChanged: (value) { - // widget.controller.text = countryCode; - // }, - onChanged: (value) => widget.onNumberChange(value), + Expanded( + flex: 4, + child: Container( + margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), + child: TextField( + controller: widget.controller, + keyboardType: TextInputType.number, + maxLength: 10, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp("[0-9]")), + ], + // maxLengthEnforced: true, + // onChanged: (value) { + // widget.controller.text = countryCode; + // }, + onChanged: (value) => widget.onNumberChange(value), - decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), + decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), + ), ), - ), - ) - ]), + ) + ]), + ), ) ]), ); diff --git a/pubspec.yaml b/pubspec.yaml index 90de021b..15c10362 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 1.0.4+5 +version: 4.3.5+1 environment: sdk: ">=2.9.0 <3.0.0" @@ -32,7 +32,7 @@ dependencies: #chart - fl_chart: ^0.12.1 + fl_chart: ^0.12.3 # Permissions permission_handler: ^5.0.0+hotfix.3 @@ -187,6 +187,8 @@ dependencies: speech_to_text: path: speech_to_text + in_app_update: ^1.1.15 + badges: ^1.1.4 # open_settings: ^2.0.1 # Dep by Zohaib