From b891c1bd80503e017fa97e63b6cfce38d8e017a9 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 8 Mar 2021 20:21:12 +0300 Subject: [PATCH] theme issue --- lib/config/config.dart | 9 +- lib/config/localized_values.dart | 2 + .../service/ancillary_orders_service.dart | 24 ++ .../ancillary_orders_view_model.dart | 22 + .../ancillary_order_list_model.dart | 105 +++++ .../NewCMC/cmc_location_page.dart | 206 ++++----- .../NewCMC/new_cmc_page.dart | 404 ++++++++++-------- .../NewCMC/new_cmc_step_one_page.dart | 143 ++++--- .../NewCMC/new_cmc_step_three_page.dart | 76 ++-- .../NewCMC/new_cmc_step_tow_page.dart | 141 +++--- .../ComprehensiveMedicalCheckup/cmc_page.dart | 28 +- .../new_Home_health_care_step_one_page.dart | 52 +-- .../new_home_health_care_page.dart | 157 ++++--- .../HomeHealthCare/home_health_care_page.dart | 24 +- .../all_habib_medical_service_page.dart | 93 ++-- .../ancillary-orders/ancillaryOrders.dart | 43 ++ .../​ health_calculators.dart | 23 +- lib/pages/Blood/blood_donation.dart | 8 +- lib/pages/Blood/my_balance_page.dart | 6 +- .../components/SearchByClinic.dart | 15 +- lib/pages/login/confirm-login.dart | 39 +- .../medical/balance/advance_payment_page.dart | 8 +- .../medical/balance/my_balance_page.dart | 21 +- lib/pages/medical/balance/new_text_Field.dart | 112 +++-- lib/theme/theme_value.dart | 2 + lib/uitl/translations_delegate_base.dart | 2 + .../bottom_navigation_item.dart | 5 +- lib/widgets/buttons/secondary_button.dart | 23 +- .../data_display/services)contaniner.dart | 2 +- lib/widgets/data_display/text.dart | 12 +- .../others/app_scaffold_pharmacy_widget.dart | 6 +- .../pharmacy/bottom_nav_pharmacy_item.dart | 10 +- 32 files changed, 1088 insertions(+), 735 deletions(-) create mode 100644 lib/core/service/ancillary_orders_service.dart create mode 100644 lib/core/viewModels/ancillary_orders_view_model.dart create mode 100644 lib/models/anicllary-orders/ancillary_order_list_model.dart create mode 100644 lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f896d304..37d586f3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; const PACKAGES_CATEGORIES = '/api/categories'; const PACKAGES_PRODUCTS = '/api/products'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -//const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -435,6 +435,11 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; +// Encillary Orders + +const GET_ANCILLARY_ORDERS = + 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; + //Pharmacy wishlist // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2042d265..ea709ddd 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1956,4 +1956,6 @@ const Map localizedValues = { }, "order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"}, "shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"}, + "ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"}, + }; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart new file mode 100644 index 00000000..5adf5305 --- /dev/null +++ b/lib/core/service/ancillary_orders_service.dart @@ -0,0 +1,24 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; + +class AncillaryOrdersService extends BaseService { + List _ancillaryLists = List(); + List get ancillaryLists => _ancillaryLists; + + Future getOrders() async { + Map body = Map(); + + hasError = false; + + await baseAppClient.post(GET_ANCILLARY_ORDERS, + onSuccess: (dynamic response, int statusCode) { + response['AncillaryOrderList'].forEach((item) { + ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/ancillary_orders_view_model.dart b/lib/core/viewModels/ancillary_orders_view_model.dart new file mode 100644 index 00000000..2d92a402 --- /dev/null +++ b/lib/core/viewModels/ancillary_orders_view_model.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; + +import 'base_view_model.dart'; +import '../../locator.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; + +class AnciallryOrdersViewModel extends BaseViewModel { + bool hasError = false; + + AncillaryOrdersService _ancillaryService = locator(); + + Future getOrders() async { + hasError = false; + setState(ViewState.Busy); + await _ancillaryService.getOrders(); + if (_ancillaryService.hasError) { + error = _ancillaryService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/models/anicllary-orders/ancillary_order_list_model.dart b/lib/models/anicllary-orders/ancillary_order_list_model.dart new file mode 100644 index 00000000..76ef3a7d --- /dev/null +++ b/lib/models/anicllary-orders/ancillary_order_list_model.dart @@ -0,0 +1,105 @@ +class AncillaryOrdersListModel { + List ancillaryOrderList; + Null errCode; + String message; + int patientID; + String patientName; + int patientType; + int projectID; + String projectName; + String setupID; + int statusCode; + + AncillaryOrdersListModel( + {this.ancillaryOrderList, + this.errCode, + this.message, + this.patientID, + this.patientName, + this.patientType, + this.projectID, + this.projectName, + this.setupID, + this.statusCode}); + + AncillaryOrdersListModel.fromJson(Map json) { + if (json['AncillaryOrderList'] != null) { + ancillaryOrderList = new List(); + json['AncillaryOrderList'].forEach((v) { + ancillaryOrderList.add(new AncillaryOrderList.fromJson(v)); + }); + } + errCode = json['ErrCode']; + message = json['Message']; + patientID = json['PatientID']; + patientName = json['PatientName']; + patientType = json['PatientType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + statusCode = json['StatusCode']; + } + + Map toJson() { + final Map data = new Map(); + if (this.ancillaryOrderList != null) { + data['AncillaryOrderList'] = + this.ancillaryOrderList.map((v) => v.toJson()).toList(); + } + data['ErrCode'] = this.errCode; + data['Message'] = this.message; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PatientType'] = this.patientType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['StatusCode'] = this.statusCode; + return data; + } +} + +class AncillaryOrderList { + String appointmentDate; + int appointmentNo; + int clinicID; + String clinicName; + int doctorID; + String doctorName; + String orderDate; + int orderNo; + + AncillaryOrderList( + {this.appointmentDate, + this.appointmentNo, + this.clinicID, + this.clinicName, + this.doctorID, + this.doctorName, + this.orderDate, + this.orderNo}); + + AncillaryOrderList.fromJson(Map json) { + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + orderDate = json['OrderDate']; + orderNo = json['OrderNo']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['OrderDate'] = this.orderDate; + data['OrderNo'] = this.orderNo; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index 4e396427..72aa40dc 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -22,127 +22,135 @@ class CMCLocationPage extends StatefulWidget { final double longitude; final dynamic model; - const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) + const CMCLocationPage( + {Key key, this.onPick, this.latitude, this.longitude, this.model}) : super(key: key); @override - _CMCLocationPageState createState() => - _CMCLocationPageState(); + _CMCLocationPageState createState() => _CMCLocationPageState(); } -class _CMCLocationPageState - extends State { +class _CMCLocationPageState extends State { double latitude = 0; double longitude = 0; @override void initState() { - latitude = widget.latitude; longitude = widget.longitude; super.initState(); } - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) {}, builder: (_, model, widget) => AppScaffold( - isShowDecPage: false, - isShowAppBar: true, - baseViewModel: model, - body: PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () async { - print(selectedPlace); - AddNewAddressRequestModel - addNewAddressRequestModel = - new AddNewAddressRequestModel( - customer: Customer(addresses: [ - Addresses( - address1: - selectedPlace.formattedAddress, - address2: selectedPlace - .formattedAddress, - customerAttributes: "", - city: "", - createdOnUtc: "", - id: 0, - latLong: "$latitude,$longitude", - email: "") - ]), - ); + isShowDecPage: false, + isShowAppBar: true, + baseViewModel: model, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + searchForInitialValue: false, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print( + "state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: Column( + children: [ + SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () async { + print(selectedPlace); + AddNewAddressRequestModel + addNewAddressRequestModel = + new AddNewAddressRequestModel( + customer: Customer(addresses: [ + Addresses( + address1: selectedPlace + .formattedAddress, + address2: selectedPlace + .formattedAddress, + customerAttributes: "", + city: "", + createdOnUtc: "", + id: 0, + latLong: + "$latitude,$longitude", + email: "") + ]), + ); - selectedPlace.addressComponents.forEach((e) { - if (e.types.contains("country")) { - addNewAddressRequestModel.customer - .addresses[0].country = e.longName; - } - if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer - .addresses[0].zipPostalCode = - e.longName; - } - if (e.types.contains("locality")) { - addNewAddressRequestModel.customer - .addresses[0].city = - e.longName; - } - }); + selectedPlace.addressComponents + .forEach((e) { + if (e.types.contains("country")) { + addNewAddressRequestModel + .customer + .addresses[0] + .country = e.longName; + } + if (e.types + .contains("postal_code")) { + addNewAddressRequestModel + .customer + .addresses[0] + .zipPostalCode = e.longName; + } + if (e.types.contains("locality")) { + addNewAddressRequestModel + .customer + .addresses[0] + .city = e.longName; + } + }); - await model.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - AppToast.showSuccessToast( - message: "Address Added Successfully"); - } - Navigator.of(context).pop(); - }, - label: TranslationBase.of(context).addNewAddress, - ), - ], - ), - ), - ); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: false, - ), - )); + await model.addAddressInfo( + addNewAddressRequestModel: + addNewAddressRequestModel); + if (model.state == + ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast( + message: + "Address Added Successfully"); + } + Navigator.of(context).pop(); + }, + label: TranslationBase.of(context) + .addNewAddress, + ), + ], + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: false, + ), + )); } } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index 2a7696b7..f314a9bf 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -26,12 +26,10 @@ class NewCMCPage extends StatefulWidget { final CMCViewModel model; @override - _NewCMCPageState createState() => - _NewCMCPageState(); + _NewCMCPageState createState() => _NewCMCPageState(); } -class _NewCMCPageState extends State - with TickerProviderStateMixin { +class _NewCMCPageState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 1; @@ -49,7 +47,8 @@ class _NewCMCPageState extends State price: widget.model.cmcAllServicesList[0].price, serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), selectedServiceName: widget.model.cmcAllServicesList[0].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN, + selectedServiceNameAR: + widget.model.cmcAllServicesList[0].descriptionN, recordID: 1, totalPrice: widget.model.cmcAllServicesList[0].totalPrice, vAT: widget.model.cmcAllServicesList[0].vAT); @@ -98,20 +97,24 @@ class _NewCMCPageState extends State model: model, onTap: () async { UpdatePresOrderRequestModel updatePresOrderRequestModel = - UpdatePresOrderRequestModel( - presOrderID: order.presOrderID, - rejectionReason: "", - presOrderStatus: 4, editedBy: 3); + UpdatePresOrderRequestModel( + presOrderID: order.presOrderID, + rejectionReason: "", + presOrderStatus: 4, + editedBy: 3); await model.updateCmcPresOrder(updatePresOrderRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast( + message: + TranslationBase.of(context).processDoneSuccessfully); await model.getCmcAllPresOrders(); } }, )); } + return Scaffold( body: SafeArea( child: SingleChildScrollView( @@ -142,212 +145,255 @@ class _NewCMCPageState extends State children: [ widget.model.cmcAllOrderDetail.length != 0 ? FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), + widthFactor: 0.9, + child: SingleChildScrollView( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 12, - ), Container( width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), + border: Border.all( + color: Colors.grey, width: 1), + borderRadius: + BorderRadius.circular(12), + color: + Theme.of(context).primaryColor), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Texts( - TranslationBase - .of(context) - .requestID, - bold: false, - fontSize: 13, - ), SizedBox( - height: 4, + height: 12, ), - Texts( - widget.model.cmcAllOrderDetail[0].iD.toString(), - fontSize: 22, - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, + bottom: 15, + top: 15, + right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Theme.of(context) + .primaryColor), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .requestID, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model + .cmcAllOrderDetail[0].iD + .toString(), + fontSize: 22, + ), + ], ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .OrderStatus, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - - projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0] - .descriptionN : widget.model.cmcAllOrderDetail[0].description, - fontSize: 22, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, + bottom: 15, + top: 15, + right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Theme.of(context) + .primaryColor), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .OrderStatus, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + projectViewModel.isArabic + ? widget + .model + .cmcAllOrderDetail[0] + .descriptionN + : widget + .model + .cmcAllOrderDetail[0] + .description, + fontSize: 22, + ), + ], + ), ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, + bottom: 15, + top: 15, + right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Theme.of(context) + .primaryColor), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .pickupDate, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + widget + .model + .cmcAllOrderDetail[ + 0] + .createdOn)), + fontSize: 22, + ), + ], ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).pickupDate, - bold: false, - fontSize: 13, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Theme.of(context) + .primaryColor), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .serviceName, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + !projectViewModel.isArabic + ? widget + .model + .cmcAllOrderDetail[0] + .description + .toString() + : widget + .model + .cmcAllOrderDetail[0] + .descriptionN + .toString(), + fontSize: 22, + ), + ], + ), ), SizedBox( - height: 4, + height: 12, ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), - fontSize: 22, - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Center( + child: Container( + width: MediaQuery.of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: TranslationBase.of( + context) + .cancel + .toUpperCase(), + onTap: () { + showConfirmMessage( + widget.model, + widget.model + .cmcAllOrderDetail[0]); + }, + color: Colors.red[800], + disabled: false, + textColor: Theme.of(context) + .backgroundColor), ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).serviceName, - bold: false, - fontSize: 13, - ), SizedBox( - height: 4, - ), - Texts( - !projectViewModel.isArabic?widget.model.cmcAllOrderDetail[0].description - .toString() : - widget.model.cmcAllOrderDetail[0] - .descriptionN - .toString(), - fontSize: 22, + height: 22, ), ], ), ), - SizedBox( - height: 12, - ), - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: TranslationBase.of(context).cancel.toUpperCase(), - onTap: () { - showConfirmMessage(widget.model, - widget.model.cmcAllOrderDetail[0]); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), - ), - ), SizedBox( height: 22, ), ], ), ), - SizedBox( - height: 22, - ), - ], - ), - ), - ) + ) : NewCMCStepOnePage( - changePageViewIndex: changePageViewIndex, - cMCInsertPresOrderRequestModel: - cMCInsertPresOrderRequestModel, - model: widget.model, - ), + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, + model: widget.model, + ), NewCMCStepTowPage( longitude: _longitude, latitude: _latitude, changePageViewIndex: changePageViewIndex, - cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + cmcInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, model: widget.model, - ), NewCMCStepThreePage( + ), + NewCMCStepThreePage( changePageViewIndex: changePageViewIndex, - cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + cmcInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, model: widget.model, ), ], diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index b80d125a..c07b8345 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -62,14 +62,14 @@ class _NewCMCStepOnePageState extends State { ), Column( children: - widget.model.cmcAllServicesList.map((service) { + widget.model.cmcAllServicesList.map((service) { return Container( margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( border: - Border.all(color: Colors.grey, width: 1), + Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Column( children: [ Row( @@ -79,53 +79,52 @@ class _NewCMCStepOnePageState extends State { activeColor: Colors.red[800], onChanged: (newValue) async { PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: service.price, - serviceID: service.serviceID - .toString(), - selectedServiceName: - service.description, - selectedServiceNameAR: - service.descriptionN, - recordID: 1, - totalPrice: - service.totalPrice, - vAT: service.vAT); + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: service.price, + serviceID: service.serviceID + .toString(), + selectedServiceName: + service.description, + selectedServiceNameAR: + service.descriptionN, + recordID: 1, + totalPrice: + service.totalPrice, + vAT: service.vAT); setState(() { widget .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList = - [ + .patientERCMCInsertServicesList = [ patientERCMCInsertServicesList ]; }); CMCGetItemsRequestModel - cMCGetItemsRequestModel = - new CMCGetItemsRequestModel( - checkupType: newValue); + cMCGetItemsRequestModel = + new CMCGetItemsRequestModel( + checkupType: newValue); await widget.model.getCheckupItems( cMCGetItemsRequestModel: - cMCGetItemsRequestModel); + cMCGetItemsRequestModel); }, groupValue: widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList - .length > - 0 + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList + .length > + 0 ? int.parse(widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList[ - 0] - .serviceID) + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList[ + 0] + .serviceID) : 1), Expanded( child: Padding( padding: const EdgeInsets.all(20.0), child: Texts( - projectViewModel.isArabic ? service - .descriptionN : service - .description, + projectViewModel.isArabic + ? service.descriptionN + : service.description, fontSize: 15, ), ), @@ -144,14 +143,18 @@ class _NewCMCStepOnePageState extends State { height: 30, ), Container( - color: Colors.white, + color: Theme.of(context).primaryColor, width: double.infinity, child: Column( children: [ Row( children: [ - Container(margin: EdgeInsets.only( - right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,)) + Container( + margin: EdgeInsets.only(right: 10, left: 10), + child: Texts( + TranslationBase.of(context).coveredService, + fontWeight: FontWeight.bold, + )) ], ), Column( @@ -163,10 +166,10 @@ class _NewCMCStepOnePageState extends State { child: Container( margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( - color: Colors.white), + color: Theme.of(context).primaryColor), child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ SizedBox( height: 12, @@ -182,17 +185,18 @@ class _NewCMCStepOnePageState extends State { width: 0.5, color: Colors.grey)), //borderRadius: , - color: Colors.white), + color: + Theme.of(context).primaryColor), child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ - Container(margin: EdgeInsets.only( - right: 10, left: 10), - child: Texts( - item.itemName, - fontSize: 15, fontWeight: FontWeight.bold - ), + Container( + margin: EdgeInsets.only( + right: 10, left: 10), + child: Texts(item.itemName, + fontSize: 15, + fontWeight: FontWeight.bold), ), ], ), @@ -222,37 +226,34 @@ class _NewCMCStepOnePageState extends State { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - label: TranslationBase - .of(context) - .next, - textColor: Theme - .of(context) - .backgroundColor, + label: TranslationBase.of(context).next, + textColor: Theme.of(context).backgroundColor, color: Colors.grey[800], onTap: () async { if (widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList.length != - 0 || + .patientERCMCInsertServicesList.length != + 0 || widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList == + .patientERCMCInsertServicesList == null) { int index = widget.model.cmcAllServicesList.length; PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: widget - .model.cmcAllServicesList[index - 1].price, - serviceID: widget - .model.cmcAllServicesList[index - 1].serviceID - .toString(), - selectedServiceName: widget.model - .cmcAllServicesList[index - 1].description, - selectedServiceNameAR: widget.model - .cmcAllServicesList[index - 1].descriptionN, - recordID: 1, - totalPrice: widget - .model.cmcAllServicesList[index - 1].totalPrice, - vAT: widget.model.cmcAllServicesList[index - 1].vAT); + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: widget + .model.cmcAllServicesList[index - 1].price, + serviceID: widget + .model.cmcAllServicesList[index - 1].serviceID + .toString(), + selectedServiceName: widget.model + .cmcAllServicesList[index - 1].description, + selectedServiceNameAR: widget.model + .cmcAllServicesList[index - 1].descriptionN, + recordID: 1, + totalPrice: widget + .model.cmcAllServicesList[index - 1].totalPrice, + vAT: + widget.model.cmcAllServicesList[index - 1].vAT); widget.cMCInsertPresOrderRequestModel .patientERCMCInsertServicesList = [ diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index eea9853b..75699a5c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -22,15 +22,13 @@ class NewCMCStepThreePage extends StatefulWidget { {Key key, this.changePageViewIndex, this.model, - this.cmcInsertPresOrderRequestModel}); + this.cmcInsertPresOrderRequestModel}); @override - _NewCMCStepThreePageState createState() => - _NewCMCStepThreePageState(); + _NewCMCStepThreePageState createState() => _NewCMCStepThreePageState(); } -class _NewCMCStepThreePageState - extends State { +class _NewCMCStepThreePageState extends State { Completer _controller = Completer(); static CameraPosition _kGooglePlex = CameraPosition( @@ -49,8 +47,7 @@ class _NewCMCStepThreePageState widget.cmcInsertPresOrderRequestModel.latitude.hashCode .toString(), ), - position: LatLng( - widget.cmcInsertPresOrderRequestModel.latitude, + position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude)), ); _kGooglePlex = CameraPosition( @@ -86,15 +83,16 @@ class _NewCMCStepThreePageState ), Container( decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(12)), padding: EdgeInsets.all(8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase - .of(context) - .orderLocation + " : ", fontWeight: FontWeight.bold,), + Texts( + TranslationBase.of(context).orderLocation + " : ", + fontWeight: FontWeight.bold, + ), SizedBox( height: 12, ), @@ -115,40 +113,38 @@ class _NewCMCStepThreePageState SizedBox( height: 12, ), - Texts(TranslationBase - .of(context) - .selectedService), + Texts(TranslationBase.of(context).selectedService), ...List.generate( widget.cmcInsertPresOrderRequestModel .patientERCMCInsertServicesList.length, - (index) => - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .serviceName, - fontSize: 12, fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), - Texts( - projectViewModel.isArabic ? widget + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).serviceName, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + Texts( + projectViewModel.isArabic + ? widget .cmcInsertPresOrderRequestModel .patientERCMCInsertServicesList[index] - .selectedServiceNameAR : widget + .selectedServiceNameAR + : widget .cmcInsertPresOrderRequestModel .patientERCMCInsertServicesList[index] .selectedServiceName, - fontSize: 15, - bold: true, - ), - ], + fontSize: 15, + bold: true, ), - ), + ], + ), + ), ) ], ), @@ -165,9 +161,7 @@ class _NewCMCStepThreePageState Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - label: TranslationBase - .of(context) - .confirm, + label: TranslationBase.of(context).confirm, color: Colors.grey[800], onTap: () async { await widget.model.insertPresPresOrder( @@ -176,9 +170,7 @@ class _NewCMCStepThreePageState widget.changePageViewIndex(0); } }, - textColor: Theme - .of(context) - .backgroundColor), + textColor: Theme.of(context).backgroundColor), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index d9d4c56a..3d969d9e 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -37,17 +37,14 @@ class NewCMCStepTowPage extends StatefulWidget { : super(key: key); @override - _NewCMCStepTowPageState createState() => - _NewCMCStepTowPageState(); + _NewCMCStepTowPageState createState() => _NewCMCStepTowPageState(); } -class _NewCMCStepTowPageState - extends State { +class _NewCMCStepTowPageState extends State { double latitude = 0; double longitude = 0; AddressInfo _selectedAddress; - @override void initState() { if (widget.cmcInsertPresOrderRequestModel.latitude == null) { @@ -61,17 +58,18 @@ class _NewCMCStepTowPageState setLatitudeAndLongitude({bool isSetState = false, String latLong}) { if (latLong == null) - latLong = widget.model.addressesList[widget.model.addressesList - .length - 1].latLong; + latLong = widget + .model.addressesList[widget.model.addressesList.length - 1].latLong; List latLongArr = latLong.split(','); latitude = double.parse(latLongArr[0]); longitude = double.parse(latLongArr[1]); } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( + return AppScaffold( isShowDecPage: false, body: Stack( children: [ @@ -84,7 +82,6 @@ class _NewCMCStepTowPageState autocompleteLanguage: projectViewModel.currentLanguage, enableMapTypeButton: true, searchForInitialValue: false, - onPlacePicked: (PickResult result) { print(result.adrAddress); widget.changePageViewIndex(3); @@ -95,57 +92,56 @@ class _NewCMCStepTowPageState return isSearchBarFocused ? Container() : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - Navigator.push( - context, - FadePage( - page: - CMCLocationPage( - latitude: latitude, - longitude: longitude, - - ), - ), - ); - }, - label: TranslationBase.of(context).addNewAddress, - ), - SizedBox(height: 10,), - SecondaryButton( - color: Colors.red - [800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.cmcInsertPresOrderRequestModel - .latitude = - selectedPlace.geometry.location.lat; - widget.cmcInsertPresOrderRequestModel - .longitude = - selectedPlace.geometry.location.lng; - }); - widget.changePageViewIndex(3); - }, - label: TranslationBase.of(context).confirm, - ), - ], - ) - ), - ); + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: Column( + children: [ + SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + Navigator.push( + context, + FadePage( + page: CMCLocationPage( + latitude: latitude, + longitude: longitude, + ), + ), + ); + }, + label: TranslationBase.of(context) + .addNewAddress, + ), + SizedBox( + height: 10, + ), + SecondaryButton( + color: Colors.red[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.cmcInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).confirm, + ), + ], + )), + ); }, initialPosition: LatLng(latitude, longitude), useCurrentLocation: false, @@ -160,37 +156,36 @@ class _NewCMCStepTowPageState // height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded(child: Texts(getAddressName(), fontSize: 14,),), + Expanded( + child: Texts( + getAddressName(), + fontSize: 14, + ), + ), Icon(Icons.arrow_drop_down) ], ), ), ), - height: 56, width: double.infinity, color: Theme - .of(context) - .scaffoldBackgroundColor, - + height: 56, + width: double.infinity, + color: Theme.of(context).scaffoldBackgroundColor, ) ], ), ); - - } - void confirmSelectLocationDialog(List addresses) { showDialog( context: context, child: SelectLocationDialog( addresses: addresses, - selectedAddress: _selectedAddress - , + selectedAddress: _selectedAddress, onValueSelected: (value) { setLatitudeAndLongitude(latLong: value.latLong); setState(() { diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 4f6213d5..f1d3e72f 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -17,8 +17,7 @@ class CMCPage extends StatefulWidget { _CMCPageState createState() => _CMCPageState(); } -class _CMCPageState extends State - with SingleTickerProviderStateMixin { +class _CMCPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; @override @@ -36,14 +35,18 @@ class _CMCPageState extends State @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async{ - await model.getCmcAllPresOrders(); - + onModelReady: (model) async { + await model.getCmcAllPresOrders(); }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - description:TranslationBase.of(context).infoCMC, - imagesInfo: [ImagesInfo(imageAr: 'assets/images/Wifi-AR.png',imageEn: 'assets/images/wifi-EN.png', isAsset: true)], + description: TranslationBase.of(context).infoCMC, + imagesInfo: [ + ImagesInfo( + imageAr: 'assets/images/Wifi-AR.png', + imageEn: 'assets/images/wifi-EN.png', + isAsset: true) + ], appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, body: Scaffold( extendBodyBehindAppBar: true, @@ -58,9 +61,7 @@ class _CMCPageState extends State child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), + color: Theme.of(context).primaryColor.withOpacity(0.8), height: 70.0, ), ), @@ -76,7 +77,7 @@ class _CMCPageState extends State color: Theme.of(context).dividerColor, width: 0.7), ), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Center( child: TabBar( isScrollable: true, @@ -86,7 +87,7 @@ class _CMCPageState extends State indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( @@ -99,7 +100,8 @@ class _CMCPageState extends State Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).orderLog), + child: + Texts(TranslationBase.of(context).orderLog), ), ), ], 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 447ba177..86ee791b 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 @@ -31,19 +31,20 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget { _NewHomeHealthCareStepOnePageState(); } -class _NewHomeHealthCareStepOnePageState extends State { - +class _NewHomeHealthCareStepOnePageState + extends State { PickResult _result; - @override void initState() { - if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = []; + if (widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList == + null) + widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList = []; super.initState(); } - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -67,9 +68,7 @@ class _NewHomeHealthCareStepOnePageState extends State _getCurrentLocation(); } - _getCurrentLocation() async { - await getLastKnownPosition().then((value) { - _latitude = value.latitude; - _longitude = value.longitude; - }).catchError((e) { - _longitude = 0; - _latitude = 0; - }); - } + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } @override void dispose() { @@ -87,7 +87,9 @@ class _NewHomeHealthCarePageState extends State if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast( + message: + TranslationBase.of(context).processDoneSuccessfully); await model.getHHCAllPresOrders(); // await model.getHHCAllServices(); } @@ -105,7 +107,9 @@ class _NewHomeHealthCarePageState extends State child: Column( children: [ Container( - margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), child: StepsWidget( index: _currentIndex, changeCurrentTab: _changeCurrentTab, @@ -130,11 +134,13 @@ class _NewHomeHealthCarePageState extends State width: double.infinity, margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( - border: Border.all(color: Colors.grey, width: 1), + border: Border.all( + color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ SizedBox( height: 12, @@ -142,7 +148,10 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, + bottom: 15, + top: 15, + right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -151,13 +160,14 @@ class _NewHomeHealthCarePageState extends State ), ), // borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: + Theme.of(context).primaryColor), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) + TranslationBase.of(context) .requestID, bold: false, fontSize: 13, @@ -166,7 +176,8 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - widget.model.pendingOrder.iD.toString(), + widget.model.pendingOrder.iD + .toString(), fontSize: 22, ), ], @@ -175,7 +186,10 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, + bottom: 15, + top: 15, + right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -184,13 +198,14 @@ class _NewHomeHealthCarePageState extends State ), ), // borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: + Theme.of(context).primaryColor), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) + TranslationBase.of(context) .OrderStatus, bold: false, fontSize: 13, @@ -199,11 +214,11 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - - projectViewModel.isArabic ? widget - .model.pendingOrder - .descriptionN : widget.model - .pendingOrder.description, + projectViewModel.isArabic + ? widget.model.pendingOrder + .descriptionN + : widget.model.pendingOrder + .description, fontSize: 22, ), ], @@ -212,7 +227,10 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, + bottom: 15, + top: 15, + right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -221,12 +239,15 @@ class _NewHomeHealthCarePageState extends State ), ), // borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: + Theme.of(context).primaryColor), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).pickupDate, + TranslationBase.of(context) + .pickupDate, bold: false, fontSize: 13, ), @@ -234,9 +255,14 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(widget - .model.pendingOrder.createdOn)), + DateUtil + .getDayMonthYearDateFormatted( + DateUtil + .convertStringToDate( + widget + .model + .pendingOrder + .createdOn)), fontSize: 22, ), ], @@ -247,7 +273,10 @@ class _NewHomeHealthCarePageState extends State (index) => Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, + bottom: 15, + top: 15, + right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -256,14 +285,14 @@ class _NewHomeHealthCarePageState extends State ), ), // borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context) + .primaryColor), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) + TranslationBase.of(context) .serviceName, bold: false, fontSize: 13, @@ -273,12 +302,16 @@ class _NewHomeHealthCarePageState extends State ), Texts( projectViewModel.isArabic - ? widget.model - .hhcAllOrderDetail[index] - .descriptionN - : widget.model - .hhcAllOrderDetail[index] - .description, + ? widget + .model + .hhcAllOrderDetail[ + index] + .descriptionN + : widget + .model + .hhcAllOrderDetail[ + index] + .description, fontSize: 22, bold: true, ), @@ -291,18 +324,24 @@ class _NewHomeHealthCarePageState extends State ), Center( child: Container( - width: - MediaQuery.of(context).size.width * 0.85, + width: MediaQuery.of(context) + .size + .width * + 0.85, child: SecondaryButton( - label: TranslationBase.of(context).cancel.toUpperCase(), + label: TranslationBase.of(context) + .cancel + .toUpperCase(), onTap: () { - showConfirmMessage(widget.model, - widget.model.hhcAllOrderDetail[0]); + showConfirmMessage( + widget.model, + widget.model + .hhcAllOrderDetail[0]); }, color: Colors.red[800], disabled: false, - textColor: - Theme.of(context).backgroundColor), + textColor: Theme.of(context) + .backgroundColor), ), ), SizedBox( @@ -315,22 +354,24 @@ class _NewHomeHealthCarePageState extends State ) : NewHomeHealthCareStepOnePage( changePageViewIndex: _changeCurrentTab, - patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + patientERInsertPresOrderRequestModel: + patientERInsertPresOrderRequestModel, model: widget.model, ), NewHomeHealthCareStepTowPage( latitude: _latitude, longitude: _longitude, changePageViewIndex: _changeCurrentTab, - patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + patientERInsertPresOrderRequestModel: + patientERInsertPresOrderRequestModel, model: widget.model, ), NewHomeHealthCareStepThreePage( changePageViewIndex: _changeCurrentTab, - patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + patientERInsertPresOrderRequestModel: + patientERInsertPresOrderRequestModel, model: widget.model, ) - ], ), ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index 1c10e594..b39c918f 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -37,15 +37,19 @@ class _HomeHealthCarePageState extends State @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model){ + onModelReady: (model) { model.getHHCAllPresOrders(); }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, description: TranslationBase.of(context).HHCNotAuthMsg, appBarTitle: TranslationBase.of(context).homeHealthCare, - imagesInfo: [ImagesInfo(imageAr: 'assets/images/Wifi-AR.png',imageEn: 'assets/images/wifi-EN.png', isAsset: true)], - + imagesInfo: [ + ImagesInfo( + imageAr: 'assets/images/Wifi-AR.png', + imageEn: 'assets/images/wifi-EN.png', + isAsset: true) + ], body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -77,7 +81,7 @@ class _HomeHealthCarePageState extends State color: Theme.of(context).dividerColor, width: 0.7), ), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Center( child: TabBar( isScrollable: true, @@ -87,19 +91,25 @@ class _HomeHealthCarePageState extends State indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).homeHealthCare), + child: Texts( + TranslationBase.of(context).homeHealthCare, + color: Colors.black, + ), ), ), Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).orderLog), + child: Texts( + TranslationBase.of(context).orderLog, + color: Colors.black, + ), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index d81fe78f..fe8f73f6 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -58,8 +58,12 @@ class _AllHabibMedicalServiceState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))}); + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => { + Geolocator.getLastKnownPosition() + .then((value) => setLocation(value)) + }); }); super.initState(); } @@ -98,12 +102,14 @@ class _AllHabibMedicalServiceState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).healthWeatherIndicators, + TranslationBase.of(context) + .healthWeatherIndicators, color: Colors.white, fontWeight: FontWeight.w600, ), Texts( - TranslationBase.of(context).healthTipsBasedOnCurrentWeather, + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, color: Colors.white, fontSize: 14, ), @@ -131,7 +137,11 @@ class _AllHabibMedicalServiceState extends State { width: 60, height: 60, ), - Directionality(textDirection: TextDirection.ltr, child: AppText(weather, fontSize: 22, color: Colors.white)) + Directionality( + textDirection: TextDirection.ltr, + child: AppText(weather, + fontSize: 22, + color: Colors.white)) ], ), Texts( @@ -151,7 +161,8 @@ class _AllHabibMedicalServiceState extends State { Navigator.pop(context); widget.goToMyProfile(); }, - imageLocation: 'assets/images/new-design/my_file_bottom_bar.png', + imageLocation: + 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), ServicesContainer( @@ -173,7 +184,8 @@ class _AllHabibMedicalServiceState extends State { ), ), ), - imageLocation: 'assets/images/new-design/booking_icon_active.png', + imageLocation: + 'assets/images/new-design/booking_icon_active.png', title: TranslationBase.of(context).bookAppo, ), ServicesContainer( @@ -183,15 +195,28 @@ class _AllHabibMedicalServiceState extends State { page: PaymentService(), ), ), - imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: PaymentService(), + ), + ), + imageLocation: + 'assets/images/comprehensive_medical_checkup_logo.png', + title: TranslationBase.of(context).anicllaryOrders, + ), ServicesContainer( onTap: () => Navigator.push( context, FadePage(), ), - imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).covid19_driveThrueTest, ), ServicesContainer( @@ -224,13 +249,17 @@ class _AllHabibMedicalServiceState extends State { page: InsuranceUpdate(), ), ), - imageLocation: 'assets/images/medical/insurance_card_icon.png', + imageLocation: + 'assets/images/medical/insurance_card_icon.png', title: TranslationBase.of(context).updateInsurance, ), ServicesContainer( onTap: () => Navigator.push( context, - FadePage(page: authUser.patientID == null ? EReferralIndexPage() : EReferralPage()), + FadePage( + page: authUser.patientID == null + ? EReferralIndexPage() + : EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: TranslationBase.of(context).ereferral, @@ -242,7 +271,8 @@ class _AllHabibMedicalServiceState extends State { page: MyFamily(), ), ), - imageLocation: 'assets/images/new-design/family_menu_icon_red.png', + imageLocation: + 'assets/images/new-design/family_menu_icon_red.png', title: TranslationBase.of(context).myFamily, ), if (projectViewModel.havePrivilege(35)) @@ -251,7 +281,8 @@ class _AllHabibMedicalServiceState extends State { context, FadePage(page: ChildVaccinesPage()), ), - imageLocation: 'assets/images/new-design/children_vaccines_icon.png', + imageLocation: + 'assets/images/new-design/children_vaccines_icon.png', title: TranslationBase.of(context).childVaccine, ), ServicesContainer( @@ -261,7 +292,8 @@ class _AllHabibMedicalServiceState extends State { page: ToDo(isShowAppBar: true), ), ), - imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', + imageLocation: + 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), if (projectViewModel.havePrivilege(42)) @@ -288,7 +320,8 @@ class _AllHabibMedicalServiceState extends State { page: (HealthCalculators()), ), ), - imageLocation: 'assets/images/new-design/health_calculator_icon.png', + imageLocation: + 'assets/images/new-design/health_calculator_icon.png', title: TranslationBase.of(context).calculators, ), ServicesContainer( @@ -298,12 +331,14 @@ class _AllHabibMedicalServiceState extends State { page: HealthConverter(), ), ), - imageLocation: 'assets/images/new-design/health_convertor_icon.png', + imageLocation: + 'assets/images/new-design/health_convertor_icon.png', title: TranslationBase.of(context).converters, ), if (projectViewModel.havePrivilege(38)) ServicesContainer( - onTap: () => Navigator.push(context, FadePage(page: H2OPage())), + onTap: () => + Navigator.push(context, FadePage(page: H2OPage())), // Navigator.push( // context, // FadePage( @@ -319,7 +354,8 @@ class _AllHabibMedicalServiceState extends State { context, FadePage(), ), - imageLocation: 'assets/images/new-design/smartwatch_icon.png', + imageLocation: + 'assets/images/new-design/smartwatch_icon.png', title: TranslationBase.of(context).smartWatches, ), ServicesContainer( @@ -329,12 +365,15 @@ class _AllHabibMedicalServiceState extends State { page: ParkingPage(), ), ), - imageLocation: 'assets/images/new-design/parking_system_icon.png', + imageLocation: + 'assets/images/new-design/parking_system_icon.png', title: TranslationBase.of(context).parking, ), ServicesContainer( - onTap: () => launch("https://hmgwebservices.com/vt_mobile/html/index.html"), - imageLocation: 'assets/images/new-design/virtual_tour_icon.png', + onTap: () => launch( + "https://hmgwebservices.com/vt_mobile/html/index.html"), + imageLocation: + 'assets/images/new-design/virtual_tour_icon.png', title: TranslationBase.of(context).vTour, ), ServicesContainer( @@ -342,10 +381,12 @@ class _AllHabibMedicalServiceState extends State { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); }, - imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', + imageLocation: + 'assets/images/new-design/twitter_dashboard_icon.png', title: TranslationBase.of(context).latestNews, ), ServicesContainer( @@ -368,7 +409,8 @@ class _AllHabibMedicalServiceState extends State { getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); @@ -382,7 +424,8 @@ class _AllHabibMedicalServiceState extends State { }); } else { setState(() { - weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; + weather = + data != null ? data['Temperature'].toString() + '\u2103' : '--'; }); } } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart new file mode 100644 index 00000000..57b134bf --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +class AnicllaryOrders extends StatefulWidget { + @override + _AnicllaryOrdersState createState() => _AnicllaryOrdersState(); +} + +class _AnicllaryOrdersState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).parking, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), child: Container()))); + } +} diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index 80e0079f..dbd8939c 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -66,7 +66,7 @@ class _HealthCalculatorsState extends State isScrollable: true, indicatorWeight: 4.0, indicatorColor: Colors.red, - labelColor: Theme.of(context).primaryColor, + labelColor: Theme.of(context).buttonColor, labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), unselectedLabelColor: Colors.grey, @@ -74,13 +74,15 @@ class _HealthCalculatorsState extends State Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts(TranslationBase.of(context).generalHealth), + child: Texts( + TranslationBase.of(context).generalHealth), ), ), Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts(TranslationBase.of(context).womanHealth), + child: + Texts(TranslationBase.of(context).womanHealth), ), ), ], @@ -119,7 +121,8 @@ class _HealthCalculatorsState extends State child: MedicalProfileItem( title: TranslationBase.of(context).bmi, imagePath: 'bmi_health_calculator.png', - subTitle: TranslationBase.of(context).calcHealth, + subTitle: + TranslationBase.of(context).calcHealth, ), ), ), @@ -137,7 +140,8 @@ class _HealthCalculatorsState extends State child: MedicalProfileItem( title: TranslationBase.of(context).calories, imagePath: 'calories-calculator.png', - subTitle: TranslationBase.of(context).calcHealth, + subTitle: + TranslationBase.of(context).calcHealth, ), ), ), @@ -159,7 +163,8 @@ class _HealthCalculatorsState extends State child: MedicalProfileItem( title: TranslationBase.of(context).bmr, imagePath: 'BMR_calculator.png', - subTitle: TranslationBase.of(context).calcHealth, + subTitle: + TranslationBase.of(context).calcHealth, ), ), ), @@ -215,9 +220,11 @@ class _HealthCalculatorsState extends State ); }, child: MedicalProfileItem( - title: TranslationBase.of(context).carbohydrate, + title: + TranslationBase.of(context).carbohydrate, imagePath: 'carb_protein.png', - subTitle: TranslationBase.of(context).proteinFat, + subTitle: + TranslationBase.of(context).proteinFat, ), ), ), diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 76ad2e1d..adff790c 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -101,7 +101,7 @@ class _BloodDonationPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -124,7 +124,7 @@ class _BloodDonationPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -148,7 +148,7 @@ class _BloodDonationPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -228,7 +228,7 @@ class _BloodDonationPageState extends State { children: [ Center( child: Container( - color: Colors.white, + color: Theme.of(context).primaryColor, width: 350, child: InkWell( onTap: () { diff --git a/lib/pages/Blood/my_balance_page.dart b/lib/pages/Blood/my_balance_page.dart index 26665c2b..06bd50f6 100644 --- a/lib/pages/Blood/my_balance_page.dart +++ b/lib/pages/Blood/my_balance_page.dart @@ -48,11 +48,11 @@ class MyBalancePage extends StatelessWidget { children: [ Texts( TranslationBase.of(context).totalBalance, - color: Colors.white, + color: Theme.of(context).primaryColor, ), Texts( '${model.totalAdvanceBalanceAmount ?? 0} SAR', - color: Colors.white, + color: Theme.of(context).primaryColor, bold: true, ), ], @@ -68,7 +68,7 @@ class MyBalancePage extends StatelessWidget { height: 65, margin: EdgeInsets.only(top: 8), decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 733bbe10..63c5e8e1 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -309,13 +309,14 @@ class _SearchByClinicState extends State { patientDoctorAppointmentListHospital) async { isProjectLoaded = false; Navigator.push( - context, - FadePage( - page: SearchResults( - isLiveCareAppointment: false, - doctorsList: docList, - patientDoctorAppointmentListHospital: - patientDoctorAppointmentListHospital))).then((value) { + context, + FadePage( + page: SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))) + .then((value) { getProjectsList(); }); } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 851c7729..1952de64 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -658,10 +658,9 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - Texts( - TranslationBase.of(context).verifyWhatsApp, - fontSize: SizeConfig.textMultiplier * 2, - ) + Texts(TranslationBase.of(context).verifyWhatsApp, + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.black) ], ), ))); @@ -690,11 +689,10 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - Texts( - TranslationBase.of(context).verifySMS, - fontSize: SizeConfig.textMultiplier * 2, - textAlign: TextAlign.center, - ) + Texts(TranslationBase.of(context).verifySMS, + fontSize: SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + color: Colors.black) ], ), ))); @@ -721,10 +719,9 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - Texts( - TranslationBase.of(context).verifyFingerprint, - fontSize: SizeConfig.textMultiplier * 2, - ) + Texts(TranslationBase.of(context).verifyFingerprint, + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.black) ], ), ))); @@ -752,10 +749,9 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - Texts( - TranslationBase.of(context).verifyFaceID, - fontSize: SizeConfig.textMultiplier * 2, - ) + Texts(TranslationBase.of(context).verifyFaceID, + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.black) ], ), ))); @@ -791,11 +787,10 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - Texts( - TranslationBase.of(context).moreVerification, - fontSize: SizeConfig.textMultiplier * 1.8, - textAlign: TextAlign.center, - ) + Texts(TranslationBase.of(context).moreVerification, + fontSize: SizeConfig.textMultiplier * 1.8, + textAlign: TextAlign.center, + color: Colors.black) ], ), ))); diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 0d752e9f..6611c779 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -94,7 +94,7 @@ class _AdvancePaymentPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -125,7 +125,7 @@ class _AdvancePaymentPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -168,7 +168,7 @@ class _AdvancePaymentPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -189,7 +189,7 @@ class _AdvancePaymentPageState extends State { height: 65, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 1edbcbf6..8f80eeeb 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -13,12 +13,15 @@ import 'package:hexcolor/hexcolor.dart'; import 'advance_payment_page.dart'; class MyBalancePage extends StatelessWidget { - List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); return BaseView( onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), builder: (_, model, w) => AppScaffold( @@ -53,9 +56,9 @@ class MyBalancePage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, + '${model.totalAdvanceBalanceAmount ?? 0} ' + + TranslationBase.of(context).sar, color: Colors.white, bold: true, ), @@ -76,16 +79,16 @@ class MyBalancePage extends StatelessWidget { height: 65, margin: EdgeInsets.only(top: 8), decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + + TranslationBase.of(context).sar, bold: true, ), Texts(model.patientAdvanceBalanceAmountList[index] @@ -94,7 +97,9 @@ class MyBalancePage extends StatelessWidget { ), ), ), - SizedBox(height: MediaQuery.of(context).size.height * 0.13 ,) + SizedBox( + height: MediaQuery.of(context).size.height * 0.13, + ) ], ), ), diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart index ad9eb580..6d368a6a 100644 --- a/lib/pages/medical/balance/new_text_Field.dart +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -42,38 +42,39 @@ final _mobileFormatter = NumberTextInputFormatter(); class NewTextFields extends StatefulWidget { NewTextFields( {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.hintColor,this.isEnabled=true}) + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor, + this.isEnabled = true}) : super(key: key); final String hintText; @@ -142,7 +143,6 @@ class _NewTextFieldsState extends State { super.dispose(); } - bool _determineReadOnly() { if (widget.readOnly != null && widget.readOnly) { _focusNode.unfocus(); @@ -156,12 +156,11 @@ class _NewTextFieldsState extends State { Widget build(BuildContext context) { return AnimatedContainer( duration: Duration(milliseconds: 300), - decoration:BoxDecoration( + decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.white), + color: Theme.of(context).primaryColor), child: Container( margin: EdgeInsets.only(top: 8), - child: TextFormField( enabled: widget.isEnabled, initialValue: widget.initialValue, @@ -171,10 +170,10 @@ class _NewTextFieldsState extends State { textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) : widget.onSubmit, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, @@ -190,45 +189,36 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - - style: Theme.of(context) - .textTheme - .body2 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.body2.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] : widget.inputFormatters, decoration: InputDecoration( labelText: widget.hintText, - labelStyle: TextStyle(color: Colors.black), + labelStyle: + TextStyle(color: Theme.of(context).textTheme.bodyText1.color), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), + color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), + color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12), ), ), diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index 9f26bb6f..129174ee 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -36,6 +36,7 @@ defaultTheme({fontName}) { highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xffffffff), + buttonColor: Colors.black, toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: @@ -86,6 +87,7 @@ invertThemes({fontName}) { highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff515A5D), + buttonColor: Colors.black, toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 9b52b54d..d9d03112 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1573,6 +1573,8 @@ class TranslationBase { String get shippingAddresss => localizedValues["shipping-address"][locale.languageCode]; String get covidAlert => localizedValues["covid-alert"][locale.languageCode]; + String get anicllaryOrders => + localizedValues["ancillary-orders"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 391b6a3d..9a3bbafe 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -18,7 +18,8 @@ class BottomNavigationItem extends StatelessWidget { final int currentIndex; final String name; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); BottomNavigationItem( {this.icon, @@ -52,7 +53,7 @@ class BottomNavigationItem extends StatelessWidget { child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor - : Theme.of(context).dividerColor, + : Colors.grey, size: 22.0), ), SizedBox( diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 8884039b..b5a4655a 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -22,7 +22,7 @@ class SecondaryButton extends StatefulWidget { this.label = "", this.icon, this.iconOnly = false, - this.color , + this.color, this.textColor = Colors.white, this.onTap, this.loading: false, @@ -144,8 +144,10 @@ class _SecondaryButtonState extends State onTapCancel: () { _animationController.forward(); }, - onTap: () =>{ widget.disabled ? null : widget.onTap(), }, - // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), + onTap: () => { + widget.disabled ? null : widget.onTap(), + }, + // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, child: Transform.scale( scale: _buttonSize, @@ -177,8 +179,9 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor, - ), + color: widget.disabled + ? Colors.grey + : widget.color ?? Theme.of(context).buttonColor), ), ), Positioned( @@ -191,7 +194,9 @@ class _SecondaryButtonState extends State height: MediaQuery.of(context).size.width * 2.2, decoration: BoxDecoration( shape: BoxShape.circle, - color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor, + color: widget.disabled + ? Colors.grey + : widget.color ?? Theme.of(context).buttonColor, ), ), ), @@ -237,8 +242,10 @@ class _SecondaryButtonState extends State style: TextStyle( color: widget.textColor, fontSize: widget.small ? 12.0 : 15.0, - // fontWeight: FontWeight.w800, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // fontWeight: FontWeight.w800, + fontFamily: projectViewModel.isArabic + ? 'Cairo' + : 'WorkSans'), ), ) ], diff --git a/lib/widgets/data_display/services)contaniner.dart b/lib/widgets/data_display/services)contaniner.dart index 91b0b59d..cb0b3774 100644 --- a/lib/widgets/data_display/services)contaniner.dart +++ b/lib/widgets/data_display/services)contaniner.dart @@ -15,7 +15,7 @@ class ServicesContainer extends StatelessWidget { height: 60, margin: EdgeInsets.all(8), decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 9797defb..40aabfe3 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -203,7 +203,10 @@ class _TextsState extends State { Stack( children: [ Text( - !hidden ? text : (text.substring(0, + !hidden + ? text + : (text.substring( + 0, text.length > widget.maxLength ? widget.maxLength : text.length)), @@ -217,13 +220,16 @@ class _TextsState extends State { style: widget.style != null ? _getFontStyle().copyWith( fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color != null ? widget.color : null, + color: widget.color != null + ? widget.color + : Theme.of(context).textTheme.bodyText1.color, fontWeight: widget.fontWeight ?? _getFontWeight(), ) : TextStyle( decoration: widget.decoration, fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color ?? Colors.black, + color: widget.color ?? + Theme.of(context).textTheme.bodyText1.color, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), diff --git a/lib/widgets/others/app_scaffold_pharmacy_widget.dart b/lib/widgets/others/app_scaffold_pharmacy_widget.dart index c3bd8a47..001bc955 100644 --- a/lib/widgets/others/app_scaffold_pharmacy_widget.dart +++ b/lib/widgets/others/app_scaffold_pharmacy_widget.dart @@ -93,7 +93,7 @@ class PharmacyAppScaffold extends StatelessWidget { ) : buildBodyWidget(), bottomSheet: bottomSheet, - floatingActionButton: floatingActionButton ?? floatingActionButton, + // floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() // floatingActionButton: FloatingSearchButton(), @@ -105,7 +105,7 @@ class PharmacyAppScaffold extends StatelessWidget { } buildBodyWidget() { - // return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); - return Stack(children: [body, FloatingSearchButton()]); + return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); + //return Stack(children: [body, FloatingSearchButton()]); } } diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart index 9d46e2eb..47ff1b23 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; @@ -48,9 +49,8 @@ class BottomNavPharmacyItem extends StatelessWidget { ), Container( child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).primaryColor, + color: + currentIndex == index ? secondaryColor : Colors.grey, size: 22.0), ), SizedBox( @@ -61,9 +61,7 @@ class BottomNavPharmacyItem extends StatelessWidget { Texts( title, textAlign: TextAlign.center, - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).primaryColor, + color: currentIndex == index ? secondaryColor : Colors.grey, fontSize: 11, ), ],