From 9c7e8e3637c26283d8b52feeb5006aff461f012d Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Mon, 11 Oct 2021 16:27:14 +0300 Subject: [PATCH 01/33] Back Button on Landing Page 1 --- lib/config/config.dart | 4 +- lib/pages/landing/landing_page.dart | 25 ++++--- .../vital_sing_chart_and_detials.dart | 14 ++-- lib/widgets/charts/sync_fu_chart.dart | 69 +++++++++++++++++++ pubspec.yaml | 1 + 5 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 lib/widgets/charts/sync_fu_chart.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 7840b97d..d7ffabcd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// 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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index f96cf7f4..86c158ad 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -610,21 +610,28 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(1); }, ), - MedicalProfilePageNew(onTap: (){ - changeCurrentTab(0); - },), - Search(onBackClick: (){ - changeCurrentTab(0); - },), + MedicalProfilePageNew( + onTap: () { + changeCurrentTab(0); + }, + ), + Search( + onBackClick: () { + changeCurrentTab(0); + }, + ), MyFamily( isAppbarVisible: false, onBackClick: () { changeCurrentTab(0); }, ), - ToDo(isShowAppBar: true,onBackClick: (){ - changeCurrentTab(0); - },), + ToDo( + isShowAppBar: true, + onBackClick: () { + changeCurrentTab(0); + }, + ), ], // Please do not remove the BookingOptions from this array ), RobotIcon() diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index ea29909b..62498d51 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/sync_fu_chart.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -53,12 +54,13 @@ class _VitalSingChartAndDetialsState extends State { shape: cardRadius(12), elevation: 1, margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), - child: ShowChart( - title: widget.name, - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, - horizontalInterval: 8, - ), + // child: ShowChart( + // title: widget.name, + // timeSeries: timeSeriesData, + // indexes: timeSeriesData.length ~/ 5.5, + // horizontalInterval: 8, + // ), + child: SyncFuChart(), ), Card( shape: cardRadius(12), diff --git a/lib/widgets/charts/sync_fu_chart.dart b/lib/widgets/charts/sync_fu_chart.dart new file mode 100644 index 00000000..ca0a626e --- /dev/null +++ b/lib/widgets/charts/sync_fu_chart.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:syncfusion_flutter_charts/sparkcharts.dart'; + +class SyncFuChart extends StatelessWidget { + + List<_SalesData> data = [ + _SalesData('Jan', 35), + _SalesData('Feb', 28), + _SalesData('Mar', 34), + _SalesData('Apr', 32), + _SalesData('May', 40), + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Syncfusion Flutter chart'), + ), + body: Column( + children: [ + //Initialize the chart widget + SfCartesianChart( + primaryXAxis: CategoryAxis(), + // Chart title + title: ChartTitle(text: 'Half yearly sales analysis'), + // Enable legend + legend: Legend(isVisible: true), + // Enable tooltip + tooltipBehavior: TooltipBehavior(enable: true), + series: >[ + LineSeries<_SalesData, String>( + dataSource: data, + xValueMapper: (_SalesData sales, _) => sales.year, + yValueMapper: (_SalesData sales, _) => sales.sales, + name: 'Sales', + // Enable data label + dataLabelSettings: DataLabelSettings(isVisible: true)) + ]), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + //Initialize the spark charts widget + child: SfSparkLineChart.custom( + //Enable the trackball + trackball: SparkChartTrackball(activationMode: SparkChartActivationMode.tap), + //Enable marker + marker: SparkChartMarker(displayMode: SparkChartMarkerDisplayMode.all), + //Enable data label + labelDisplayMode: SparkChartLabelDisplayMode.all, + xValueMapper: (int index) => data[index].year, + yValueMapper: (int index) => data[index].sales, + dataCount: 5, + ), + ), + ) + ], + ), + ); + } +} + +class _SalesData { + _SalesData(this.year, this.sales); + + final String year; + final double sales; +} diff --git a/pubspec.yaml b/pubspec.yaml index c5541181..e1732307 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -104,6 +104,7 @@ dependencies: # Calendar # table_calendar: ^2.3.0 syncfusion_flutter_calendar: ^18.4.49 + syncfusion_flutter_charts: any # SVG Images flutter_svg: ^0.18.0 From 0a9d0e5eaa3c2f8bee3d982959ec1e4e18b49f91 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 11 Oct 2021 16:27:32 +0300 Subject: [PATCH 02/33] fixes --- .../medical/prescriptions_service.dart | 2 +- .../medical/prescriptions_view_model.dart | 19 ++- .../AlHabibMedicalService/h2o/h2o_page.dart | 160 ++++-------------- 3 files changed, 42 insertions(+), 139 deletions(-) diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index ce91be53..fa2a24c6 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -34,10 +34,10 @@ class PrescriptionsService extends BaseService { } Future getPrescriptionsOrders() async { + prescriptionsOrderList.clear(); Map body = Map(); body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { - prescriptionsOrderList.clear(); response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); }); diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 38009f45..0c1fafdf 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -77,14 +77,17 @@ class PrescriptionsViewModel extends BaseViewModel { } getPrescriptionsOrders({bool showLoading = false}) async { - if (showLoading) setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } + // print(showLoading); + setState(ViewState.Busy); + Future.delayed(new Duration(milliseconds: 300)).then((value) async { + await _prescriptionsService.getPrescriptionsOrders(); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + }); } setFilterType(FilterType filterType) { diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 982b9044..9478ae38 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -1,20 +1,15 @@ import 'dart:ui'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; -import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; -import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; -import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -77,132 +72,37 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { }, ), ], - body: Scaffold( - // extendBodyBehindAppBar: true, - // appBar: PreferredSize( - // preferredSize: Size.fromHeight(65.0), - // child: Stack( - // children: [ - // Positioned( - // bottom: 1, - // left: 0, - // right: 0, - // child: BackdropFilter( - // filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - // child: Container( - // color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), - // height: 70.0, - // ), - // ), - // ), - // Center( - // child: Container( - // height: 60.0, - // alignment: Alignment.center, - // // margin: EdgeInsets.only(top: 10.0), - // // width: MediaQuery.of(context).size.width * 0.9, - // - // child: TabBar( - // isScrollable: false, - // controller: _tabController, - // indicatorWeight: 5.0, - // indicatorSize: TabBarIndicatorSize.tab, - // indicatorColor: Colors.red[800], - // labelColor: Theme.of(context).primaryColor, - // labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), - // unselectedLabelColor: Colors.grey[800], - // tabs: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.28, - // child: Center( - // child: Texts(TranslationBase.of(context).today), - // ), - // ), - // Container( - // width: MediaQuery.of(context).size.width * 0.28, - // child: Center( - // child: Texts(TranslationBase.of(context).week), - // ), - // ), - // Container( - // width: MediaQuery.of(context).size.width * 0.28, - // child: Center( - // child: Texts(TranslationBase.of(context).month), - // ), - // ), - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // backgroundColor: Colors.white, - body: Column( - children: [ - TabBar( + body: Column( + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)], + ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), controller: _tabController, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Color(0xff2B353E), - unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - labelStyle: TextStyle( - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - unselectedLabelStyle: TextStyle( - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)], + children: [TodayPage(), WeekPage(), MonthPage()], ), - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [TodayPage(), WeekPage(), MonthPage()], - ), - ) - ], - ), - bottomNavigationBar: BottomNavBar( - changeIndex: (index) { - if (index == 0) { - IS_VOICE_COMMAND_CLOSED = false; - } else if (index == 1) { - Navigator.push( - context, - FadePage( - page: AppScaffold( - appBarTitle: TranslationBase.of(context).medicalProfile, - isShowAppBar: true, - showHomeAppBarIcon: false, - appBarIcons: [ - IconButton( - icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), - color: Colors.white, - onPressed: () => Navigator.of(context).pushNamed( - SETTINGS, - ), - ), - ], - body: MedicalProfilePageNew()))); - } else if (index == 2) { - Navigator.of(context).pushNamedAndRemoveUntil(HOME, (Route route) => false); - } else if (index == 3) { - Navigator.of(context).pushNamed(MY_FAMILIY); - } else if (index == 4) { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false))); - } - }, - showHomeIcon: true, - index: 0, - ), + ) + ], ), ), ); From e62e3dae1bfa14cf3a9bfb41ddbaddc37476afa6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 11 Oct 2021 18:42:03 +0300 Subject: [PATCH 03/33] CMC APIs coverting to RC --- lib/config/config.dart | 5 + .../cmc_insert_pres_order_request_model.dart | 13 +- .../get_cmc_service_response_model.dart | 72 ++- .../AlHabibMedicalService/cmc_service.dart | 38 +- lib/core/service/client/base_app_client.dart | 87 +-- .../AlHabibMedicalService/cmc_view_model.dart | 17 +- .../NewCMC/new_cmc_page.dart | 8 +- .../NewCMC/new_cmc_step_one_page.dart | 69 +- .../NewCMC/new_cmc_step_three_page.dart | 2 +- lib/pages/MyAppointments/SchedulePage.dart | 597 +++++++++++++----- 10 files changed, 586 insertions(+), 322 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 7840b97d..f12c9191 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -438,6 +438,11 @@ const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; + +// CMC RC SERVICES +const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc'; +const ADD_CMC_ORDER_RC = 'rc/api/cmc/add'; + //Pharmacy wishlist const GET_WISHLIST = "shopping_cart_items/"; const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart index 534988a7..8cece1f5 100644 --- a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart @@ -73,20 +73,21 @@ class CMCInsertPresOrderRequestModel { data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; data['generalid'] = this.generalid; - data['PatientOutSA'] = this.patientOutSA; + data['patientOutSa'] = this.patientOutSA; + data['isOutPatient'] = this.patientOutSA == 0 ? false : true; data['SessionID'] = this.sessionID; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['DeviceTypeID'] = this.deviceTypeID; - data['PatientID'] = this.patientID; + data['patientId'] = this.patientID.toString(); data['TokenID'] = this.tokenID; data['PatientTypeID'] = this.patientTypeID; data['PatientType'] = this.patientType; - data['Latitude'] = this.latitude; - data['Longitude'] = this.longitude; - data['CreatedBy'] = this.createdBy; + data['latitude'] = this.latitude; + data['longitude'] = this.longitude; + // data['CreatedBy'] = this.createdBy; data['OrderServiceID'] = this.orderServiceID; if (this.patientERCMCInsertServicesList != null) { - data['PatientER_CMC_InsertServicesList'] = + data['procedures'] = this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList(); } return data; diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart index 5f356e2b..42d2fb99 100644 --- a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart @@ -1,44 +1,56 @@ class GetCMCServicesResponseModel { - String description; - String descriptionN; - int iD; - bool isActive; + int id; + String serviceID; + int orderServiceID; + String text; + String textN; dynamic price; - int serviceID; - dynamic totalPrice; - dynamic vAT; + dynamic priceVAT; + dynamic priceTotal; + bool isEnabled; + int orderId; + int quantity; GetCMCServicesResponseModel( - {this.description, - this.descriptionN, - this.iD, - this.isActive, - this.price, + {this.id, this.serviceID, - this.totalPrice, - this.vAT}); + this.orderServiceID, + this.text, + this.textN, + this.price, + this.priceVAT, + this.priceTotal, + this.isEnabled, + this.orderId, + this.quantity}); GetCMCServicesResponseModel.fromJson(Map json) { - description = json['Description']; - descriptionN = json['DescriptionN']; - iD = json['ID']; - isActive = json['IsActive']; - price = json['Price']; - serviceID = json['ServiceID']; - totalPrice = json['TotalPrice']; - vAT = json['VAT']; + id = json['id']; + serviceID = json['serviceID']; + orderServiceID = json['orderServiceID']; + text = json['text']; + textN = json['textN']; + price = json['price']; + priceVAT = json['priceVAT']; + priceTotal = json['priceTotal']; + isEnabled = json['isEnabled']; + orderId = json['orderId']; + quantity = json['quantity']; } Map toJson() { final Map data = new Map(); - data['Description'] = this.description; - data['DescriptionN'] = this.descriptionN; - data['ID'] = this.iD; - data['IsActive'] = this.isActive; - data['Price'] = this.price; - data['ServiceID'] = this.serviceID; - data['TotalPrice'] = this.totalPrice; - data['VAT'] = this.vAT; + data['id'] = this.id; + data['serviceID'] = this.serviceID; + data['orderServiceID'] = this.orderServiceID; + data['text'] = this.text; + data['textN'] = this.textN; + data['price'] = this.price; + data['priceVAT'] = this.priceVAT; + data['priceTotal'] = this.priceTotal; + data['isEnabled'] = this.isEnabled; + data['orderId'] = this.orderId; + data['quantity'] = this.quantity; return data; } } diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index 012e4d90..b79b6fdb 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -23,17 +23,30 @@ class CMCService extends BaseService { bool isOrderUpdated; Future getCMCAllServices() async { - GetCMCServicesRequestModel getCMCServicesRequestModel = new GetCMCServicesRequestModel(genderID: authenticatedUserObject.user.gender, identificationNo: authenticatedUserObject.user.patientIdentificationNo); + GetCMCServicesRequestModel getCMCServicesRequestModel = + new GetCMCServicesRequestModel(genderID: authenticatedUserObject.user.gender, identificationNo: authenticatedUserObject.user.patientIdentificationNo); hasError = false; - await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, onSuccess: (dynamic response, int statusCode) { + + // RC IMPLEMENTATION + await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isAllowAny: true, onSuccess: (dynamic response, int statusCode) { cmcAllServicesList.clear(); - response['PatientER_CMC_GetAllServicesList'].forEach((data) { + response.forEach((data) { cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getCMCServicesRequestModel.toJson()); + }, body: {}); + + // await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, onSuccess: (dynamic response, int statusCode) { + // cmcAllServicesList.clear(); + // response['PatientER_CMC_GetAllServicesList'].forEach((data) { + // cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: getCMCServicesRequestModel.toJson()); } Future getCmcAllPresOrders() async { @@ -87,12 +100,25 @@ class CMCService extends BaseService { }, 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(); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + return reqId; + } + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { hasError = false; - String reqId=""; + String reqId = ""; await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { isOrderUpdated = true; - reqId=response['RequestNo'].toString(); + reqId = response['RequestNo'].toString(); }, 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 b0c0925f..a9d03fd5 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -126,60 +126,65 @@ class BaseAppClient { } else { var decoded = utf8.decode(response.bodyBytes); var parsed = json.decode(utf8.decode(response.bodyBytes)); - if (parsed['Response_Message'] != null) { + + if (isAllowAny) { onSuccess(parsed, statusCode); } else { - if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); - } - if (parsed['ErrorType'] == 2) { - await logout(); - } - if (isAllowAny) { + if (parsed['Response_Message'] != null) { onSuccess(parsed, statusCode); - } else if (parsed['IsAuthenticated'] == null) { - if (parsed['isSMSSent'] == true) { - onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 1) { - onSuccess(parsed, statusCode); - } else if (parsed['Result'] == 'OK') { + } else { + if (parsed['ErrorType'] == 4) { + navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); + } + if (parsed['ErrorType'] == 2) { + await logout(); + } + if (isAllowAny) { onSuccess(parsed, statusCode); - } else { - if (parsed != null) { + } else if (parsed['IsAuthenticated'] == null) { + if (parsed['isSMSSent'] == true) { + onSuccess(parsed, statusCode); + } else if (parsed['MessageStatus'] == 1) { + onSuccess(parsed, statusCode); + } else if (parsed['Result'] == 'OK') { onSuccess(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logout(); + if (parsed != null) { + onSuccess(parsed, statusCode); + } else { + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + logout(); + } } - } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { - onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { - if (parsed['SameClinicApptList'] != null) { + } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { - if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); + } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + if (parsed['SameClinicApptList'] != null) { + onSuccess(parsed, statusCode); + } else { + if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['ErrorSearchMsg'] == null) { + onFailure("Server Error found with no available message", statusCode); + } else { + onFailure(parsed['ErrorSearchMsg'], statusCode); + } } else { - onFailure(parsed['ErrorSearchMsg'], statusCode); + onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } - } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } - } - // else if (!parsed['IsAuthenticated']) { - // await logout(); - // } - else { - if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); - } else { - if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); + // else if (!parsed['IsAuthenticated']) { + // await logout(); + // } + else { + if (parsed['SameClinicApptList'] != null) { + onSuccess(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + if (parsed['message'] != null) { + onFailure(parsed['message'] ?? parsed['message'], statusCode); + } else { + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + } } } } diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index de007d67..8080ddec 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -38,9 +38,6 @@ class CMCViewModel extends BaseViewModel { Future getCMCAllServices() async { await _cMCService.getCMCAllServices(); - CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD); - - await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel, isFirst: true); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.Error); @@ -92,7 +89,6 @@ class CMCViewModel extends BaseViewModel { await _cMCService.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); } - //TODO check it in uat Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { setState(ViewState.Busy); order.createdBy = user.patientID; @@ -104,7 +100,20 @@ class CMCViewModel extends BaseViewModel { } else { getCmcAllPresOrders(); } + return requestId; + } + Future insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); + String requestId = await _cMCService.insertCMCOrderRC(order: order); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.ErrorLocal); + } else { + getCmcAllPresOrders(); + } return requestId; } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index 859580ef..5093729c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -46,11 +46,11 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( 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, + selectedServiceName: widget.model.cmcAllServicesList[0].text, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].textN, recordID: 1, - totalPrice: widget.model.cmcAllServicesList[0].totalPrice, - vAT: widget.model.cmcAllServicesList[0].vAT); + totalPrice: widget.model.cmcAllServicesList[0].priceTotal, + vAT: widget.model.cmcAllServicesList[0].priceVAT); cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); } 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 32aaa898..5e2b0498 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 @@ -63,18 +63,18 @@ class _NewCMCStepOnePageState extends State { return Row( children: [ Radio( - value: widget.model.cmcAllServicesList[index].serviceID, + value: num.tryParse(widget.model.cmcAllServicesList[index].serviceID), activeColor: Colors.red[800], onChanged: (newValue) async { selectedItem = index; PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( price: widget.model.cmcAllServicesList[index].price, - serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(), - selectedServiceName: widget.model.cmcAllServicesList[index].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN, + serviceID: widget.model.cmcAllServicesList[index].serviceID, + selectedServiceName: widget.model.cmcAllServicesList[index].text, + selectedServiceNameAR: widget.model.cmcAllServicesList[index].textN, recordID: 1, - totalPrice: widget.model.cmcAllServicesList[index].totalPrice, - vAT: widget.model.cmcAllServicesList[index].vAT); + totalPrice: widget.model.cmcAllServicesList[index].priceTotal, + vAT: widget.model.cmcAllServicesList[index].priceVAT); setState(() { widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; }); @@ -93,7 +93,7 @@ class _NewCMCStepOnePageState extends State { bottom: 20, ), child: Text( - projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description, + projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].textN : widget.model.cmcAllServicesList[index].text, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -135,50 +135,6 @@ class _NewCMCStepOnePageState extends State { ), ], ), - // Card( - // shape: cardRadius(12), - // elevation: 4, - // child: Container( - // width: double.infinity, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: const EdgeInsets.only(left: 12, right: 12, top: 12), - // child: Text( - // TranslationBase.of(context).coveredService, - // style: TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.w600, - // letterSpacing: -0.45, - // ), - // ), - // ), - // ListView.separated( - // itemBuilder: (context, index) { - // return Padding( - // padding: const EdgeInsets.all(12.0), - // child: Text( - // widget.model.checkupItems[index].itemName, - // style: TextStyle( - // fontSize: 12, - // fontWeight: FontWeight.w600, - // letterSpacing: -0.45, - // ), - // ), - // ); - // }, - // separatorBuilder: (context, index) { - // return mDivider(Colors.grey); - // }, - // physics: NeverScrollableScrollPhysics(), - // shrinkWrap: true, - // itemCount: widget.model.checkupItems.length, - // ), - // ], - // ), - // ), - // ), ], ), ), @@ -194,13 +150,16 @@ class _NewCMCStepOnePageState extends State { PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( price: widget.model.cmcAllServicesList[selectedItem].price, serviceID: widget.model.cmcAllServicesList[selectedItem].serviceID.toString(), - selectedServiceName: widget.model.cmcAllServicesList[selectedItem].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[selectedItem].descriptionN, + selectedServiceName: widget.model.cmcAllServicesList[selectedItem].text, + selectedServiceNameAR: widget.model.cmcAllServicesList[selectedItem].textN, recordID: 1, - totalPrice: widget.model.cmcAllServicesList[selectedItem].totalPrice, - vAT: widget.model.cmcAllServicesList[selectedItem].vAT, + totalPrice: widget.model.cmcAllServicesList[selectedItem].priceTotal, + vAT: widget.model.cmcAllServicesList[selectedItem].priceVAT, ); + widget.cMCInsertPresOrderRequestModel.patientID = projectViewModel.user.patientID; + widget.cMCInsertPresOrderRequestModel.patientOutSA = projectViewModel.user.outSA; + widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; await widget.model.getCustomerInfo(); // if (widget.model.state == ViewState.ErrorLocal) { 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 c314812c..a1b7ccee 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 @@ -202,7 +202,7 @@ class _NewCMCStepThreePageState extends State { color: CustomColors.green, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - String requestId = await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); + String requestId = await widget.model.insertCMCOrderRC(order: widget.cmcInsertPresOrderRequestModel); GifLoaderDialogUtils.hideDialog(context); if (widget.model.state != ViewState.ErrorLocal) { //show scuccess dialog diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index 2287cff5..92fbeedf 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -1,33 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; - import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart'; -import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; class SchedulePage extends StatefulWidget { DoctorList doctorList; AppoitmentAllHistoryResultList appo; + SchedulePage({ this.appo, this.doctorList, }); + @override _SchedulePageState createState() => _SchedulePageState(); } @@ -45,6 +42,7 @@ class _SchedulePageState extends State { bool isPageChange = false; AppSharedPreferences sharedPref = AppSharedPreferences(); + @override void initState() { this.doctorList = widget.doctorList; @@ -56,169 +54,132 @@ class _SchedulePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getDoctorSchedule(doctorList), - allowAny: true, - builder: (_, model, widget) => BaseView( - onModelReady: (model2) => model2.getFreeSlots(doctorList), - allowAny: true, - builder: (_, model2, widget2) { - if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { - this.freeSlots = model2.freeSlots; - this.doctorScheduleResponse = model.getDoctorScheduleList; + onModelReady: (model) => model.getDoctorSchedule(doctorList), + allowAny: true, + builder: (_, model, widget) => BaseView( + onModelReady: (model2) => model2.getFreeSlots(doctorList), + allowAny: true, + builder: (_, model2, widget2) { + if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { + this.freeSlots = model2.freeSlots; + this.doctorScheduleResponse = model.getDoctorScheduleList; - this.generateWeeksSchedules(); - } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) { - AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); - Navigator.pop(context); - } - return AppScaffold( - appBarTitle: TranslationBase.of(context).schedule, - showNewAppBar: true, - showNewAppBarTitle: true, - isShowAppBar: true, - backgroundColor: Color(0xffF7F7F7), - baseViewModel: model2, - isShowDecPage: false, - body: Column( - children: [ - SizedBox(height: 21), - PageViewIndicator( - isActive: true, - currentPage: this.currentPage, - length: weeks.length, - ), - Expanded( - child: PageView.builder( - controller: _pageController, - itemCount: weeks.length, - onPageChanged: (index) { - setState(() { - isPageChange = true; - this.currentPage = index.toDouble(); - }); - }, - itemBuilder: (context, index) { - return ListView.separated( - itemCount: weeks[index].length, - padding: EdgeInsets.all(21), - separatorBuilder: (context, index) => SizedBox(height: 12), - itemBuilder: (context, index2) { - bool isToday = DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10); - Color toDayColor = isToday ? Color(0xff359846) : Colors.white; - - return InkWell( - onTap: () { - openBookAppointment(weeks[index][index2]); + this.generateWeeksSchedules(); + } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) { + AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); + Navigator.pop(context); + } + return AppScaffold( + appBarTitle: TranslationBase.of(context).schedule, + showNewAppBar: true, + showNewAppBarTitle: true, + isShowAppBar: true, + baseViewModel: model2, + isShowDecPage: false, + body: SizedBox( + height: MediaQuery.of(context).size.height, + child: Stack( + children: [ + Container( + margin: EdgeInsets.only(top: 40), + child: PageView.builder( + controller: _pageController, + itemCount: weeks.length, + onPageChanged: (index) { + setState(() { + isPageChange = true; + this.currentPage = index.toDouble(); + }); + }, + itemBuilder: (context, index) { + return Container( + child: ListView.builder( + itemCount: weeks[index].length, + itemBuilder: (context, index2) => InkWell( + onTap: () { + openBookAppointment(weeks[index][index2]); + }, + child: Row( + children: [ + Expanded( + flex: 1, + child: Padding( + padding: projectViewModel.isArabic ? EdgeInsets.only(right: 20) : EdgeInsets.only(left: 20), + child: Row(children: [ + Column( + children: [ + Texts( + weeks[index][index2]['DayName'], + fontSize: 13, + fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, + ), + Texts( + getDayMonths( + DateUtil.convertStringToDate( + weeks[index][index2]['Date'], + ), + ), + fontWeight: FontWeight.bold, + fontSize: 18, + ) + ], + ) + ])), + ), + Expanded( + flex: 3, + child: ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(20.0)), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, top: 15, bottom: 20), + margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7), + decoration: BoxDecoration(boxShadow: [ + DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) + ? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0)) + : BoxShadow( + color: Colors.grey[100], + blurRadius: 5, + spreadRadius: 4, + offset: Offset(0, 10), + ), + ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) + ? Texts( + TranslationBase.of(context).today, + color: Colors.green, + fontWeight: FontWeight.w600, + fontSize: 12, + marginTop: 0, + ) + : SizedBox(), + Row( + children: [ + Expanded( + child: Text( + weeks[index][index2]['WorkingHours'], + style: TextStyle( + fontWeight: FontWeight.w600, + ), + ), + ), + Icon(Icons.arrow_forward, size: 16.0), + ], + ) + ]))), + ), + ], + )))); }, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - weeks[index][index2]['DayName'], - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - letterSpacing: -0.52, - ), - ), - Text( - getDayMonths(DateUtil.convertStringToDate(weeks[index][index2]['Date'])), - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w700, - color: Color(0xff2E303A), - letterSpacing: -0.72, - ), - ), - ], - ), - ), - Expanded( - flex: 3, - child: Container( - decoration: BoxDecoration( - color: toDayColor, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - ), - child: Container( - margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), - padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.only( - bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), - topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), - ), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (isToday) - Text( - TranslationBase.of(context).today, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: toDayColor, - letterSpacing: -0.48, - ), - ), - Row( - children: [ - Expanded( - child: Text( - weeks[index][index2]['WorkingHours'], - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - letterSpacing: -0.56, - ), - ), - ), - ], - ) - ]), - ), - Icon(Icons.arrow_forward, color: Color(0xff2B353E)), - ], - ), - ), - ), - ), - ], - ), - ); - }); - }, - ), - ), - ], - ), - ); - }), - ); + )), + PageViewIndicator( + isActive: true, + currentPage: this.currentPage, + length: weeks.length, + ) + ], + ))); + })); } generateWeeksSchedules() { @@ -284,3 +245,289 @@ class _SchedulePageState extends State { // ); } } + +// import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +// import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; +// +// import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; +// import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart'; +// import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +// import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +// import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +// import 'package:flutter/material.dart'; +// import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; +// import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +// import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +// import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +// import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +// import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +// import 'package:provider/provider.dart'; +// import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +// +// class SchedulePage extends StatefulWidget { +// DoctorList doctorList; +// AppoitmentAllHistoryResultList appo; +// SchedulePage({ +// this.appo, +// this.doctorList, +// }); +// @override +// _SchedulePageState createState() => _SchedulePageState(); +// } +// +// class _SchedulePageState extends State { +// DoctorsListService service; +// PageController _pageController = PageController(); +// double currentPage = 0; +// int selectedindex = 0; +// List weeks = []; +// List doctorScheduleResponse = []; +// int weekMS = 604800 * 1000; +// DoctorList doctorList; +// List freeSlots = []; +// bool isPageChange = false; +// +// AppSharedPreferences sharedPref = AppSharedPreferences(); +// @override +// void initState() { +// this.doctorList = widget.doctorList; +// +// super.initState(); +// } +// +// @override +// Widget build(BuildContext context) { +// ProjectViewModel projectViewModel = Provider.of(context); +// return BaseView( +// onModelReady: (model) => model.getDoctorSchedule(doctorList), +// allowAny: true, +// builder: (_, model, widget) => BaseView( +// onModelReady: (model2) => model2.getFreeSlots(doctorList), +// allowAny: true, +// builder: (_, model2, widget2) { +// if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { +// this.freeSlots = model2.freeSlots; +// this.doctorScheduleResponse = model.getDoctorScheduleList; +// +// this.generateWeeksSchedules(); +// } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) { +// AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); +// Navigator.pop(context); +// } +// return AppScaffold( +// appBarTitle: TranslationBase.of(context).schedule, +// showNewAppBar: true, +// showNewAppBarTitle: true, +// isShowAppBar: true, +// backgroundColor: Color(0xffF7F7F7), +// baseViewModel: model2, +// isShowDecPage: false, +// body: Column( +// children: [ +// SizedBox(height: 21), +// PageViewIndicator( +// isActive: true, +// currentPage: this.currentPage, +// length: weeks.length, +// ), +// Expanded( +// child: PageView.builder( +// controller: _pageController, +// itemCount: weeks.length, +// onPageChanged: (index) { +// setState(() { +// isPageChange = true; +// this.currentPage = index.toDouble(); +// }); +// }, +// itemBuilder: (context, index) { +// return ListView.separated( +// itemCount: weeks[index].length, +// padding: EdgeInsets.all(21), +// separatorBuilder: (context, index) => SizedBox(height: 12), +// itemBuilder: (context, index2) { +// bool isToday = DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10); +// Color toDayColor = isToday ? Color(0xff359846) : Colors.white; +// return InkWell( +// onTap: () { +// openBookAppointment(weeks[index][index2]); +// }, +// child: Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Expanded( +// flex: 1, +// child: Column( +// mainAxisSize: MainAxisSize.min, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// weeks[index][index2]['DayName'], +// style: TextStyle( +// fontSize: 13, +// fontWeight: FontWeight.w600, +// color: Color(0xff2E303A), +// letterSpacing: -0.52, +// ), +// ), +// Text( +// getDayMonths(DateUtil.convertStringToDate(weeks[index][index2]['Date'])), +// style: TextStyle( +// fontSize: 18, +// fontWeight: FontWeight.w700, +// color: Color(0xff2E303A), +// letterSpacing: -0.72, +// ), +// ), +// ], +// ), +// ), +// Expanded( +// flex: 3, +// child: Container( +// decoration: BoxDecoration( +// color: toDayColor, +// borderRadius: BorderRadius.all( +// Radius.circular(10.0), +// ), +// boxShadow: [ +// BoxShadow( +// color: Color(0xff000000).withOpacity(.05), +// blurRadius: 27, +// offset: Offset(0, -3), +// ), +// ], +// ), +// child: Container( +// margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), +// padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), +// decoration: BoxDecoration( +// color: Colors.white, +// border: Border.all(color: Colors.white, width: 1), +// borderRadius: BorderRadius.only( +// bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), +// topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), +// bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), +// topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), +// ), +// ), +// child: Row( +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Expanded( +// child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ +// if (isToday) +// Text( +// TranslationBase.of(context).today, +// style: TextStyle( +// fontSize: 12, +// fontWeight: FontWeight.w600, +// color: toDayColor, +// letterSpacing: -0.48, +// ), +// ), +// Row( +// children: [ +// Expanded( +// child: Text( +// weeks[index][index2]['WorkingHours'], +// style: TextStyle( +// fontSize: 13, +// fontWeight: FontWeight.w600, +// color: Color(0xff2E303A), +// letterSpacing: -0.56, +// ), +// ), +// ), +// ], +// ) +// ]), +// ), +// Icon(Icons.arrow_forward, color: Color(0xff2B353E)), +// ], +// ), +// ), +// ), +// ), +// ], +// ), +// ); +// }); +// }, +// ), +// ), +// ], +// ), +// ); +// }), +// ); +// } +// +// generateWeeksSchedules() { +// this.weeks.clear(); +// for (var i = 0; i < 8; i++) { +// var weekSchedule = generateNewWeekSchedule(i); +// this.markWeekFreeDays(weekSchedule); +// this.weeks.add(weekSchedule); +// } +// //print(this.weeks); +// } +// +// markWeekFreeDays(schedule) { +// for (var workDay in schedule) { +// workDay['fullDay'] = !this.hasFreeSlot(workDay['Date']); +// } +// } +// +// generateNewWeekSchedule(weekIndex) { +// var weekMSOffset = weekIndex * weekMS; +// +// var newWeekSchedule = []; +// for (var workDay in this.doctorScheduleResponse) { +// Map newWorkDay = Map(); +// newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch + weekMSOffset); +// newWorkDay['DayName'] = workDay.dayName; +// newWorkDay['WorkingHours'] = workDay.workingHours; +// newWeekSchedule.add(newWorkDay); +// } +// return newWeekSchedule; +// } +// +// hasFreeSlot(String jsonDate) { +// var date = DateUtil.convertStringToDate(jsonDate); +// var scheduleDay = date; +// for (var event in this.freeSlots) { +// var date = DateUtil.convertStringToDate(event); +// var nDate = DateTime(date.year, date.month, date.day); +// +// if (nDate.millisecondsSinceEpoch == scheduleDay.millisecondsSinceEpoch) { +// return true; +// } +// } +// return false; +// } +// +// String getDayMonths(DateTime dateTime) { +// String dateFormat = '${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}'; +// return dateFormat; +// } +// +// openBookAppointment(selectedDate) { +// //sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate); +// Navigator.of(context).pop(selectedDate); +// // Navigator.push( +// // context, +// // FadePage( +// // page: AppointmentDetails( +// // appo: widget.appo, +// // doctorSchedule: selectedDate, +// // ), +// // ), +// // ); +// } +// } From d664a216c6cfbc9495c0f52399124654165512bb Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Tue, 12 Oct 2021 11:27:05 +0300 Subject: [PATCH 04/33] Profile Page and Back Button Click --- lib/config/localized_values.dart | 2 + lib/pages/landing/landing_page.dart | 15 +- .../vital_sing_chart_and_detials.dart | 25 +- lib/pages/settings/profile_setting.dart | 477 +++++++++++------- lib/pages/settings/settings.dart | 78 +-- lib/uitl/translations_delegate_base.dart | 3 + lib/widgets/charts/sync_fu_chart.dart | 121 ++--- pubspec.yaml | 2 +- 8 files changed, 410 insertions(+), 313 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 608c67f0..e34982a1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1497,4 +1497,6 @@ const Map localizedValues = { "years": {"en": "Years", "ar": "سنوات"}, "respirationBPM": { "en": "bpm", "ar": "نفس" }, "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, + "selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" }, + "recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" }, }; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7c83c338..13cc2dce 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -102,13 +102,18 @@ class _LandingPageState extends State with WidgetsBindingObserver { LocationUtils locationUtils; Future onWillPop() { - DateTime now = DateTime.now(); - if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) { - currentBackPressTime = now; - AppToast.showToast(message: TranslationBase.of(context).pressAgain); + if (currentTab != 0) { + changeCurrentTab(0); return Future.value(false); + } else { + DateTime now = DateTime.now(); + if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) { + currentBackPressTime = now; + AppToast.showToast(message: TranslationBase.of(context).pressAgain); + return Future.value(false); + } + return Future.value(true); } - return Future.value(true); } changeCurrentTab(int tab) { diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 62498d51..e98bcb72 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -50,17 +50,20 @@ class _VitalSingChartAndDetialsState extends State { return SingleChildScrollView( child: Column( children: [ - Card( - shape: cardRadius(12), - elevation: 1, - margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), - // child: ShowChart( - // title: widget.name, - // timeSeries: timeSeriesData, - // indexes: timeSeriesData.length ~/ 5.5, - // horizontalInterval: 8, - // ), - child: SyncFuChart(), + Container( + height: 400, + child: Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), + child: ShowChart( + title: widget.name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 8, + ), + // child: SyncFuChart(), + ), ), Card( shape: cardRadius(12), diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 838af5f9..1d2938cc 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -16,8 +18,7 @@ class ProfileSettings extends StatefulWidget { _ProfileSettings createState() => _ProfileSettings(); } -class _ProfileSettings extends State - with TickerProviderStateMixin { +class _ProfileSettings extends State with TickerProviderStateMixin { bool smsAlert = true; bool emailAlert = true; int language = 1; @@ -25,6 +26,7 @@ class _ProfileSettings extends State TextEditingController emergencyContact = new TextEditingController(); TextEditingController emailController = new TextEditingController(); TextEditingController emergencyContactName = new TextEditingController(); + @override void initState() { Future.delayed(new Duration(seconds: 0), () { @@ -37,199 +39,300 @@ class _ProfileSettings extends State Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => {}, - builder: (_, model, wi) => Container( - child: model.user != null - ? ListView(scrollDirection: Axis.vertical, children: [ - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.all(15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).fileNo, - color: Colors.black, - ), - AppText( - model.user.patientID.toString(), - color: Colors.black, - ), - ], + onModelReady: (model) => {}, + builder: (_, model, wi) => Container( + child: model.user != null + ? Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Card( + shape: cardRadius(8), + margin: EdgeInsets.zero, + elevation: 3, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).fileNo + ": ", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + Text( + model.user.patientID.toString(), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + ], + ), + ), + ), + mHeight(12), + Text( + TranslationBase.of(context).languageSetting, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + Text( + TranslationBase.of(context).selectLanguage, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ), + Row( + children: [ + Expanded( + child: Row( + children: [ + new Radio( + value: 2, + groupValue: language, + onChanged: (value) { + setState(() { + language = value; + }); + }, + ), + Text( + TranslationBase.of(context).english, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: language, + onChanged: (value) { + setState(() { + language = value; + }); + }, + ), + Text( + TranslationBase.of(context).arabic, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + ), + ], + ), + mHeight(12), + Text( + TranslationBase.of(context).alert, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + Text( + TranslationBase.of(context).recAlert, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ), + Row( + children: [ + Checkbox( + value: emailAlert, + onChanged: (value) { + setState(() { + emailAlert = value; + }); + }, + activeColor: CustomColors.accentColor, + ), + Text( + TranslationBase.of(context).emailAlert, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Checkbox( + value: smsAlert, + onChanged: (value) { + setState(() { + smsAlert = value; + }); + }, + activeColor: CustomColors.accentColor, + ), + Text( + TranslationBase.of(context).smsAlert, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + mHeight(16), + Text( + TranslationBase.of(context).contactInfo, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + mHeight(12), + inputWidget(TranslationBase.of(context).email, "", emailController), + mHeight(8), + inputWidget(TranslationBase.of(context).emergencyName, "", emergencyContactName), + mHeight(8), + inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact), + mHeight(8), + ], + ), ), ), - SizedBox( - height: 1, - width: MediaQuery.of(context).size.width, - child: Container( - color: Colors.grey[300], + ), + Container( + width: double.infinity, + child: Card( + margin: EdgeInsets.zero, + elevation: 20, + child: Padding( + padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 16), + child: DefaultButton( + TranslationBase.of(context).save, + () { + saveSettings(); + }, + ), ), ), - Padding( - child: AppText( - TranslationBase.of(context).languageSetting, - fontWeight: FontWeight.bold), - padding: EdgeInsets.all(10), + ), + ], + ) + : Center( + child: AppText(TranslationBase.of(context).loginToUseService), + ), + ), + ); + } + + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, ), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).english), - new Radio( - value: 2, - groupValue: language, - onChanged: (value) { - setState(() { - language = value; - }); - }, - ) - ], - )), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).arabic), - new Radio( - value: 1, - groupValue: language, - onChanged: (value) { - setState(() { - language = value; - }); - }, - ) - ], - )), - Padding( - child: AppText(TranslationBase.of(context).alert), - padding: EdgeInsets.all(10), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + controller: _controller, + // onChanged: (value) => {validateForm()}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, ), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).emailAlert), - Switch( - value: emailAlert, - onChanged: (value) { - setState(() { - emailAlert = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).smsAlert), - Switch( - value: smsAlert, - onChanged: (value) { - setState(() { - smsAlert = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Padding( - child: AppText(TranslationBase.of(context).contactInfo), - padding: EdgeInsets.all(10), - ), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText(TranslationBase.of(context).email), - TextField( - controller: emailController, - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), - )) - ], - )), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText(TranslationBase.of(context).emergencyName), - TextField( - controller: emergencyContactName, - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), - )) - ], - )), - Container( - color: Theme.of(context).textTheme.headline2.color, - padding: EdgeInsets.only( - top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).emergencyContact), - TextField( - controller: emergencyContact, - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + prefixIcon: prefix == null + ? null + : Text( + "+" + prefix, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w500, + color: Color(0xff2E303A), + letterSpacing: -0.56, ), - ) - ], - )), - Container( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).save, - () { - saveSettings(); - }, - )), - ], - )) - ]) - : Center( - child: - AppText(TranslationBase.of(context).loginToUseService), - ))); + ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); } getSettings(context) { GifLoaderDialogUtils.showMyDialog(context); - authService.getSettings().then((result) => { - GifLoaderDialogUtils.hideDialog(context), - setValue(result["PateintInfoForUpdateList"][0]) - }); + authService.getSettings().then((result) => {GifLoaderDialogUtils.hideDialog(context), setValue(result["PateintInfoForUpdateList"][0])}); } setValue(value) { @@ -252,10 +355,6 @@ class _ProfileSettings extends State request["IsEmailAlertRequired"] = this.emailAlert; request["IsSMSAlertRequired"] = this.smsAlert; request["PreferredLanguage"] = this.language.toString(); - authService.saveSettings(request).then((result) => { - AppToast.showSuccessToast( - message: TranslationBase.of(context).profileUpdate), - GifLoaderDialogUtils.hideDialog(context) - }); + authService.saveSettings(request).then((result) => {AppToast.showSuccessToast(message: TranslationBase.of(context).profileUpdate), GifLoaderDialogUtils.hideDialog(context)}); } } diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index 1282a636..32e4cf66 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/settings/general_setting.dart'; import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; import 'package:flutter/material.dart'; @@ -9,6 +11,7 @@ class Settings extends StatefulWidget { final int type; Settings({this.type = 0}); + @override _Settings createState() => _Settings(); } @@ -18,8 +21,7 @@ class _Settings extends State with TickerProviderStateMixin { @override void initState() { - _tabController = - new TabController(length: 2, vsync: this, initialIndex: widget.type); + _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); if (widget.type == 1) { _tabController.animateTo(1); @@ -31,45 +33,45 @@ class _Settings extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { AppGlobal.context = context; - return Scaffold( - appBar: AppBar( - actions: [ - IconButton( - icon: Icon(Icons.info, color: Colors.white), - onPressed: () { - //openInfoPage() - }, - ) - ], - bottom: TabBar( - // isScrollable: true, + return AppScaffold( + isShowAppBar: false, + isShowDecPage: false, + showNewAppBarTitle: true, + showNewAppBar: true, + appBarTitle: TranslationBase.of(context).settings, + backgroundColor: Color(0xFFF7F7F7), + body: Column( + children: [ + TabBar( + // isScrollable: true, - indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, - // indicatorSize: TabBarIndicatorSize.tab, + indicatorWeight: 3.0, + //indicatorSize: TabBarIndicatorSize.label, + // indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Theme.of(context).primaryColor, - // labelColor: Theme.of(context).primaryColor, - tabs: [ - Tab(text: TranslationBase.of(context).general), - Tab( - text: TranslationBase.of(context).profile, - ) - ], - controller: _tabController, - ), - title: Text(TranslationBase.of(context).settings, - style: TextStyle(color: Colors.white)), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), + indicatorColor: CustomColors.accentColor, + labelColor: Colors.black, + unselectedLabelColor: CustomColors.grey, + // labelColor: Theme.of(context).primaryColor, + tabs: [ + Tab(text: TranslationBase.of(context).general), + Tab( + text: TranslationBase.of(context).profile, + ) + ], + controller: _tabController, + ), + Expanded( + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + GeneralSettings(), + ProfileSettings(), + ], + controller: _tabController), + ), + ], ), - body: TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [GeneralSettings(), ProfileSettings()], - controller: _tabController), ); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0a3177e0..48e8b0bd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2361,6 +2361,9 @@ class TranslationBase { String get selectSlot => localizedValues["selectSlot"][locale.languageCode]; + String get selectLanguage => localizedValues["selectLanguage"][locale.languageCode]; + + String get recAlert => localizedValues["recAlert"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/charts/sync_fu_chart.dart b/lib/widgets/charts/sync_fu_chart.dart index ca0a626e..3119cc36 100644 --- a/lib/widgets/charts/sync_fu_chart.dart +++ b/lib/widgets/charts/sync_fu_chart.dart @@ -1,69 +1,52 @@ -import 'package:flutter/material.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; -import 'package:syncfusion_flutter_charts/sparkcharts.dart'; - -class SyncFuChart extends StatelessWidget { - - List<_SalesData> data = [ - _SalesData('Jan', 35), - _SalesData('Feb', 28), - _SalesData('Mar', 34), - _SalesData('Apr', 32), - _SalesData('May', 40), - ]; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Syncfusion Flutter chart'), - ), - body: Column( - children: [ - //Initialize the chart widget - SfCartesianChart( - primaryXAxis: CategoryAxis(), - // Chart title - title: ChartTitle(text: 'Half yearly sales analysis'), - // Enable legend - legend: Legend(isVisible: true), - // Enable tooltip - tooltipBehavior: TooltipBehavior(enable: true), - series: >[ - LineSeries<_SalesData, String>( - dataSource: data, - xValueMapper: (_SalesData sales, _) => sales.year, - yValueMapper: (_SalesData sales, _) => sales.sales, - name: 'Sales', - // Enable data label - dataLabelSettings: DataLabelSettings(isVisible: true)) - ]), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - //Initialize the spark charts widget - child: SfSparkLineChart.custom( - //Enable the trackball - trackball: SparkChartTrackball(activationMode: SparkChartActivationMode.tap), - //Enable marker - marker: SparkChartMarker(displayMode: SparkChartMarkerDisplayMode.all), - //Enable data label - labelDisplayMode: SparkChartLabelDisplayMode.all, - xValueMapper: (int index) => data[index].year, - yValueMapper: (int index) => data[index].sales, - dataCount: 5, - ), - ), - ) - ], - ), - ); - } -} - -class _SalesData { - _SalesData(this.year, this.sales); - - final String year; - final double sales; -} +// import 'package:flutter/material.dart'; +// import 'package:syncfusion_flutter_charts/charts.dart'; +// import 'package:syncfusion_flutter_charts/sparkcharts.dart'; +// +// class SyncFuChart extends StatelessWidget { +// List<_SalesData> data = [ +// _SalesData('Jan', 35), +// _SalesData('Feb', 28), +// _SalesData('Mar', 34), +// _SalesData('Apr', 32), +// _SalesData('May', 40), +// ]; +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// body: Column( +// children: [ +// //Initialize the chart widget +// SfCartesianChart( +// +// primaryXAxis: CategoryAxis(), +// primaryYAxis: CategoryAxis(minimum: 28), +// // Chart title +// title: ChartTitle(text: 'Half yearly sales analysis'), +// // Enable legend +// legend: Legend(isVisible: true), +// // Enable tooltip +// tooltipBehavior: TooltipBehavior(enable: true), +// series: >[ +// LineSeries<_SalesData, String>( +// dataSource: data, +// xValueMapper: (_SalesData sales, _) => sales.year, +// yValueMapper: (_SalesData sales, _) => sales.sales, +// name: 'Sales', +// // Enable data label +// dataLabelSettings: DataLabelSettings(isVisible: true), +// ), +// ], +// ), +// ], +// ), +// ); +// } +// } +// +// class _SalesData { +// _SalesData(this.year, this.sales); +// +// final String year; +// final double sales; +// } diff --git a/pubspec.yaml b/pubspec.yaml index e1732307..306513d4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -104,7 +104,7 @@ dependencies: # Calendar # table_calendar: ^2.3.0 syncfusion_flutter_calendar: ^18.4.49 - syncfusion_flutter_charts: any +# syncfusion_flutter_charts: any # SVG Images flutter_svg: ^0.18.0 From 5c8b809e3917e791bce5128f1b7c1f555afdadfb Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 13 Oct 2021 11:43:12 +0300 Subject: [PATCH 05/33] family file fixes --- lib/config/localized_values.dart | 8 +- .../checkpatient_for_registration.dart | 10 +- .../covid-dirvethru-questions.dart | 2 +- lib/pages/login/confirm-login.dart | 1 + lib/pages/login/register.dart | 102 ++++++------------ .../medical/medical_profile_page_new.dart | 3 +- .../bottom_navigation/bottom_nav_bar.dart | 2 +- .../bottom_navigation_item.dart | 28 ++++- lib/widgets/drawer/app_drawer_widget.dart | 5 +- 9 files changed, 78 insertions(+), 83 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 608c67f0..92d7f0b7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -316,7 +316,7 @@ const Map localizedValues = { "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم يتم حضورها"}, - "MyAppointmentsList": {"en": "Appointments", "ar": "قائمة بمواعدي"}, + "MyAppointmentsList": {"en": "Appointments", "ar": "قائمة بمواعيدي"}, "Radiology": {"en": "Radiology", "ar": "الأشعة"}, "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, "Lab": {"en": "Lab", "ar": "تحليل المختبر"}, @@ -610,7 +610,7 @@ const Map localizedValues = { "years-old": {"en": "years old", "ar": "سنة"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "refine": {"en": "Refine", "ar": "تصفية"}, - "reset": {"en": "Reset", "ar": "اعادة تعيين"}, + "reset": {"en": "Reset", "ar": "اعادة ضبط"}, "apply": {"en": "Apply", "ar": "تطبيق"}, "viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"}, "categorise": {"en": "Categories", "ar": "التطبيقات"}, @@ -1489,12 +1489,12 @@ const Map localizedValues = { "medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"}, "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"}, "rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"}, - "rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"}, + "rateAppointment": {"en": "Rate Appointment", "ar": "تقييم الموعد"}, "noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"}, "bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"}, "noSlotsError": {"en": "No appointments available for selected date", "ar": "لا توجد مواعيد متاحة للتاريخ المحدد"}, "selectSlot": {"en": "Please select Time Slot to continue", "ar": "الرجاء تحديد فترة زمنية للمتابعة"}, "years": {"en": "Years", "ar": "سنوات"}, - "respirationBPM": { "en": "bpm", "ar": "نفس" }, + "respirationBPM": {"en": "bpm", "ar": "نفس"}, "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, }; diff --git a/lib/models/Authentication/checkpatient_for_registration.dart b/lib/models/Authentication/checkpatient_for_registration.dart index 420b4adb..def8925f 100644 --- a/lib/models/Authentication/checkpatient_for_registration.dart +++ b/lib/models/Authentication/checkpatient_for_registration.dart @@ -14,6 +14,8 @@ class CheckPatientForRegistration { String tokenID; int patientID; bool isRegister; + String dob; + int isHijri; CheckPatientForRegistration( {this.patientIdentificationID, @@ -30,7 +32,9 @@ class CheckPatientForRegistration { this.deviceTypeID, this.tokenID, this.patientID, - this.isRegister}); + this.isRegister, + this.dob, + this.isHijri}); CheckPatientForRegistration.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; @@ -48,6 +52,8 @@ class CheckPatientForRegistration { tokenID = json['TokenID']; patientID = json['PatientID']; isRegister = json['isRegister']; + dob = json['DOB']; + isHijri = json['IsHijri']; } Map toJson() { @@ -67,6 +73,8 @@ class CheckPatientForRegistration { data['TokenID'] = this.tokenID; data['PatientID'] = this.patientID; data['isRegister'] = this.isRegister; + data['DOB'] = dob; + data['IsHijri'] = isHijri; return data; } } diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index 45cab249..aa1e3ea5 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -104,7 +104,7 @@ class CovidDirveThruQuestionsState extends State { Row( children: [ Text( - TranslationBase.of(context).fileNo + ":", + TranslationBase.of(context).nationalIdNumber + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 10, diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 921bec0a..ae2a4e33 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -363,6 +363,7 @@ class _ConfirmLogin extends State { var request = this.getCommonRequest(type: type); request.sMSSignature = await SMSOTP.getSignature(); GifLoaderDialogUtils.showMyDialog(context); + await this.authService.sendActivationCode(request).then((result) { GifLoaderDialogUtils.hideDialog(context); if (result != null && result['isSMSSent'] == true) { diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 1591d1d5..012669c7 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -67,19 +67,14 @@ class _Register extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - MobileNo( - onNumberChange: (value) => - {mobileNo = value, validateForm()}, - onCountryChange: (value) => countryCode = value), + MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), Container( child: TextFields( controller: nationalIDorFile, onChanged: (value) => validateForm(), keyboardType: TextInputType.number, - prefixIcon: Icon(Icons.chrome_reader_mode, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), + prefixIcon: Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)), + padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), hintText: TranslationBase.of(context).nationalID, )), Row( @@ -120,33 +115,25 @@ class _Register extends State { ), ], ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - width: SizeConfig.realScreenWidth * .9, - height: 60, - child: isHijri == 1 - ? TextFields( - onChanged: (value) => {dob = value}, - hintText: 'DD/MM/YYYY', - prefixIcon: Icon(Icons.date_range), - ) - : RaisedButton.icon( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15.0), - ), - color: Colors.white, - onPressed: () => { - if (isHijri != null) - _selectDate(context) - }, - icon: Icon(Icons.date_range), - label: Text(selectedDate != null - ? "${selectedDate.toLocal()}" - .split(' ')[0] - : TranslationBase.of(context).dob))) - ]) + Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + Container( + width: SizeConfig.realScreenWidth * .9, + height: 60, + child: isHijri == 1 + ? TextFields( + onChanged: (value) => {dob = value}, + hintText: 'DD/MM/YYYY', + prefixIcon: Icon(Icons.date_range), + ) + : RaisedButton.icon( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + color: Colors.white, + onPressed: () => {if (isHijri != null) _selectDate(context)}, + icon: Icon(Icons.date_range), + label: Text(selectedDate != null ? "${selectedDate.toLocal()}".split(' ')[0] : TranslationBase.of(context).dob))) + ]) ], ), ), @@ -165,13 +152,8 @@ class _Register extends State { Row( children: [ Expanded( - child: DefaultButton( - TranslationBase.of(context).registerNow, - () => {startRegistration()}, - textColor: Colors.white, - color: isButtonDisabled == true - ? Colors.grey - : Colors.grey[900])) + child: DefaultButton(TranslationBase.of(context).registerNow, () => {startRegistration()}, + textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Colors.grey[900])) ], ), ], @@ -181,11 +163,7 @@ class _Register extends State { } Future _selectDate(BuildContext context) async { - final DateTime picked = await showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(1950, 8), - lastDate: DateTime.now()); + final DateTime picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1950, 8), lastDate: DateTime.now()); if (picked != null && picked != selectedDate) setState(() { selectedDate = picked; @@ -193,30 +171,25 @@ class _Register extends State { } startRegistration() { + final DateFormat dateFormat = DateFormat('dd/MM/yyyy'); if (isButtonDisabled == false) { var request = CheckPatientForRegistration(); request.patientMobileNumber = int.parse(mobileNo); request.zipCode = countryCode; request.patientOutSA = countryCode == '966' ? 0 : 1; - // if (this.loginType == 1) { + request.patientIdentificationID = int.parse(nationalIDorFile.text); request.patientID = 0; request.isRegister = true; - // } else { - // request.patientIdentificationID = 0; - // request.patientID = int.parse(nationalIDorFile.text); - // } + request.dob = isHijri == 1 ? dob : dateFormat.format(selectedDate); + request.isHijri = isHijri; this.checkPatientForRegisteration(request); } } checkPatientForRegisteration(request) { GifLoaderDialogUtils.showMyDialog(context); - this - .authService - .checkPatientForRegisteration(request) - .then((response) => {checkUserStatus(response, request)}) - .catchError((err) { + this.authService.checkPatientForRegisteration(request).then((response) => {checkUserStatus(response, request)}).catchError((err) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, @@ -233,10 +206,7 @@ class _Register extends State { } void validateForm() { - if (util.validateIDBox(nationalIDorFile.text, loginType) == true && - mobileNo.length >= 9 && - util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true && - isHijri != null) { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true && isHijri != null) { setState(() { isButtonDisabled = false; }); @@ -265,8 +235,7 @@ class _Register extends State { } else { nRequest['forRegister'] = true; nRequest['isRegister'] = true; - nRequest["PatientIdentificationID"] = - nRequest["PatientIdentificationID"].toString(); + nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"].toString(); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); this.chekUserData(response['LogInTokenID']); @@ -312,12 +281,7 @@ class _Register extends State { Navigator.of(context).push(FadePage(page: ConfirmLogin())), } else - { - AppToast.showErrorToast( - message: result - ? result - : TranslationBase.of(context).somethingWentWrong) - } + {AppToast.showErrorToast(message: result ? result : TranslationBase.of(context).somethingWentWrong)} }); } diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index 8f0bb0fc..dc7ff71f 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -30,6 +30,7 @@ class _MedicalProfilePageState extends State { projectViewModel = Provider.of(context); var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); + print(myMedicalList); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget1) => AppScaffold( @@ -40,7 +41,7 @@ class _MedicalProfilePageState extends State { isHelp: true, showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).medicalFile, - onTap:widget.onTap, + onTap: widget.onTap, body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 53eb06a2..23fbaccd 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -65,7 +65,7 @@ class _BottomNavBarState extends State { index: widget.index, currentIndex: 3, name: TranslationBase.of(context).myFamily, - // isDisabled: projectViewModel.isLoginChild, + isDisabled: projectViewModel.isLoginChild, ), if (widget.index == 0) (widget.showHomeIcon) diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 820c6652..f01f70af 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -47,7 +47,13 @@ class BottomNavigationItem extends StatelessWidget { height: 15, ), Container( - child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : Colors.grey, size: 22.0), + child: Icon(currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? secondaryColor + : isDisabled + ? Colors.grey[300] + : Colors.grey, + size: 22.0), ), SizedBox( height: 2, @@ -55,7 +61,11 @@ class BottomNavigationItem extends StatelessWidget { Texts( name, textAlign: TextAlign.center, - color: currentIndex == index ? secondaryColor : Colors.grey, + color: currentIndex == index + ? secondaryColor + : isDisabled + ? Colors.grey[300] + : Colors.grey, fontSize: 11, ), SizedBox( @@ -116,7 +126,13 @@ class BottomNavigationItem extends StatelessWidget { height: 15, ), Container( - child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : isDisabled ? Colors.grey[300] : Theme.of(context).dividerColor, size: 22.0), + child: Icon(currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? secondaryColor + : isDisabled + ? Colors.grey[300] + : Theme.of(context).dividerColor, + size: 22.0), ), SizedBox( height: 2, @@ -124,7 +140,11 @@ class BottomNavigationItem extends StatelessWidget { Texts( name, textAlign: TextAlign.center, - color: currentIndex == index ? secondaryColor : isDisabled ? Colors.grey[300] : Colors.grey, + color: currentIndex == index + ? secondaryColor + : isDisabled + ? Colors.grey[300] + : Colors.grey, fontSize: 11, ), SizedBox( diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 2599dcd4..c790aeef 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -358,8 +358,7 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - if(!projectProvider.user.isFamily) - Navigator.push(context, FadePage(page: NotificationsPage())); + if (!projectProvider.user.isFamily) Navigator.push(context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3)) @@ -552,6 +551,8 @@ class _AppDrawerState extends State { this.sharedPref.clear(); if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; + } else { + result.list.isFamily = false; } // result.list.cRSVerificationStatus = result['CRSVerificationStatus']; this.sharedPref.setString(APP_LANGUAGE, currentLang); From b475adb5c33b8a1b3f885713df99568803ca7b64 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 13 Oct 2021 13:58:20 +0300 Subject: [PATCH 06/33] Updates & fixes --- assets/images/new/payment/Apple_Pay.png | Bin 0 -> 6592 bytes assets/images/new/payment/Mada.png | Bin 0 -> 10340 bytes assets/images/new/payment/Mastercard.png | Bin 0 -> 14639 bytes assets/images/new/payment/installments.png | Bin 0 -> 5041 bytes assets/images/new/payment/visa.png | Bin 0 -> 16450 bytes lib/config/localized_values.dart | 7 +- .../e_referral_service.dart | 3 + lib/core/service/client/base_app_client.dart | 10 + .../new_e_referral_step_one_page.dart | 53 ++-- .../E-Referral/referral_details.dart | 4 +- .../E-Referral/search_for_referrals_page.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 16 +- .../covid-payment-details.dart | 5 +- .../covid-payment-summary.dart | 36 +-- lib/pages/ToDoList/ToDo.dart | 14 +- lib/pages/ToDoList/payment_method_select.dart | 10 +- lib/pages/ToDoList/widgets/paymentDialog.dart | 252 +++++++----------- .../widgets/LiveCarePaymentDialog.dart | 21 +- lib/pages/livecare/widgets/clinic_list.dart | 5 +- .../PrescriptionOrderOverveiw.dart | 20 +- lib/uitl/translations_delegate_base.dart | 8 + lib/uitl/utils_new.dart | 16 ++ pubspec.yaml | 1 + 23 files changed, 224 insertions(+), 259 deletions(-) create mode 100644 assets/images/new/payment/Apple_Pay.png create mode 100644 assets/images/new/payment/Mada.png create mode 100644 assets/images/new/payment/Mastercard.png create mode 100644 assets/images/new/payment/installments.png create mode 100644 assets/images/new/payment/visa.png diff --git a/assets/images/new/payment/Apple_Pay.png b/assets/images/new/payment/Apple_Pay.png new file mode 100644 index 0000000000000000000000000000000000000000..1dc75042f37de9d6b7629dc7e3f33e7c5d5671b4 GIT binary patch literal 6592 zcmV;x89(NUP)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR92ET97b z1ONa40RR91djJ3c0J_IuqW}OIHc3Q5RCodHT?^P2RkhXtQ8BZB}_$yyo*X| z26-zl2g`eESF@9PEX+%3ob>4Ps70AKo&-$IFw&!`C2Ho4Kul8v0u?0V@~csxnCHCj z4->=u-}lX4Yi@gH)_R`z|GsZ#t-aQM_sp8T_w1Q}z4fXsy-~fhfC<10z&k)+z{D6Z z28;nO80ds3jsqS6{ssJB1cUM0#27FJjDbQKSRdX;1G9l>k_!JGRA`ju+!!zhYR|xq zVBk?8oS2$@->UX(83D$CF;Ex-r@-@apjm_A>dWO2S7L} zwfg>CZP~Jl8v_+!pmT}qFb=VQQ5gR-LVe%VH}oVRUKCaVyjYkR1GzC!)`WE_7?LI{ zlKL?JlvtJ__KiG>|DTAZ4Oj@w16~5A15W{q0TW}O_6&R$3`mB7!4Q!rSND>$$2tV{ z@%fX>NoE390DAx?#y~9@=!07Gimo|XCsly4vLvi%`#cZs*(3I;cUXbL!K&ap15*%S z^ki`Ty|3?;bBM332`gx$zoL%k0$m;IYAVJ+sTnvN(FX^<^z)HY*L-d8WlvZ^yS;)c z9lEw!_RScm9s|=*rQm>X~02?M&hoo-aErLBoUqu& zTx_~Si~8FxW59a`u0({AgvCcjPWQf6x&W)5u-MMCfF3$}%&O`Pl;P2wT?LK6H;R4^ zxL06P2UYf5n8=ez7Z`JRzHyR59B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4GfK7po0Lr_-Qs51M zy@r{yQaWT}+Yy+fv^O(jz!)$FL=2n=ZAp(RtjmO+ zsU*Eim}ziUxG`W1u(=loM;Ve3>X6yW#Fr*muqs0>hV#fVHM@Ys$~oq1D-K( zF5=-MbJ0ZP`ul#*>SN&;1I9oF8Q2MR;J6p6jdv9J29(?- zX_n1BU~^~;7z2efa2_JizJexE@RqO=(PzfSK$P|o$(l9U|kv;|RU(R<2_)jH* ym-4aaL~xZlhj^So=l=zr0r1~*@o^sS<^KT&q}%uLU57US0000ns literal 0 HcmV?d00001 diff --git a/assets/images/new/payment/Mada.png b/assets/images/new/payment/Mada.png new file mode 100644 index 0000000000000000000000000000000000000000..905a5ba893f3e650656028f91f2f7833b5408ede GIT binary patch literal 10340 zcma)CRZtvEvt8WX-QC^Y-C=Q;#ogWAHF&V#?(Q0bLvVKjED$6RZoY^A{XX=}>8Yuy zI{nbob-Lr!Rpn3+2@wGR0E&XVv?c%m!Tb+f!^8etpN)5||7{Q+nsSnWhI!(Pe-6Jj zP{Bq;1;F?Z!vi2VFvU-$MXvJOyz8fNoPkT0+|w z;wA{e*J?b-R;T~@jnud-LSSK4vy+=eHGer2g%=}} zzjHhH(l;!MC4(y%yL0^gwHvZ&8FM1TzMo4b-4GcU4tXR2ab*r)VBx zNUC=}X(`GG2Y=gh`b+!@RGNM5WjMi8SCNh~JJY1Ci6fUd=7Ap%sX)c`D`~u4@Bzmq zwfP8(L+=!_iD0QAR7uVq{lPCigg-bm<5VaX^KX0L*>Wc;#82=uNT-zL@kX&e{vPT< zMqz<>hjL)@AWkAx6M2=3F0FiYMUHU@!#b71VQ1#JA zdefrOb-9O$^wy6tqebF#Wo0FjvBv&0Q{yd$oK!fHzD`>hy5v+d!;!VwkqfLjEoPF5 zP_iK>CA;6TW_MjQ+FxiY8_21rg>8N!DKn0f6iSWQ7&4hdzHg(b50Hj(IOSHrVZmFQ zGVhEUUEJ^@EPWm!6u?vSgCem^!!~k{*ot=qm+n{un;fs^`Pt19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)SevW{AitS1iZp49W@o9!#wojx8ObsV#A5A%$h_+>&|m3li-CwL9H;M&I7z z2fpNY$_lP!4=h0T{=gvN&?j1Y1{qVJ(#uvT0m_b#y24J`Rb8J4y(CKsk{OoI8vsyR z0?rFnG$^7605Grf3$Nx=&@8>#IXgia9r&N;JmY%SV?S}<&^c3?S$~15N~D`MXj;$f zZ2l#?sc``98lC3pu%JgWA~W0p2$b5@^H#>bYBff}d)OL7p=X45+KfWbWvO;ZsLJNI z%s>qP{9qGO1dpv0;{A;9y5=%7Hv`KFLZcMvBOfm%FeP^Vq>AUTNMg%PooXj3OX3pK z%FgobeqwMs=PcK~Tfux9F;(omw9%H^Srh|m(ad$C-3__gz!>n2UGetR#A7_8;Pix9 z7{?odYNx6>EkyKLDIbk*%K*hQ#6|z(e`55N^0NlB>v7O$cWQ?_7rD=a_OVFK4(8>u zPi?gqIb~X*U+!(qS1QxdM#7gC=JPQ*(gqG+Vh-Hm+J#)X2Ux-qGJHh#dp_t3xQ;ZG z7)6)IC~zvA$>v#V)!Of|$Ty5%%h^?1O*iaH0WuCm>)^$@%8uC8*BS$(`I5P%=?V0j4s50BflXcksKcbU0=5~Az-Z8-Z|*n%BF0;YNu3DrRySWE$V zLG>?}%%eZE5>_asc^}3W!)wm+ch)Dm8+>MaI}(>`mYEtq{gQeLmfA)I>U~(N8nYKw zwZX8N(-S#XjUJOHXbt_$w#RlkXUldlBUWiDn9#qr(G!v%(|-7X=LL)5MX(}r8~rh6 zoacH~!XETo!JN0Vd#gqD?(n{SZ^F`meHze}+q~qI%M>>SmoqEKDn-BY;-2p { super.initState(); } + void showSMSDialog(EReferralViewModel model) { + SMSOTP( + context, + 1, + _selectedCountry['code'] + _mobileTextController.text, + (value) { + submit(model, value); + }, + () => { + Navigator.pop(context), + }, + ).displayDialog(context); + } + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - void showSMSDialog(EReferralViewModel model) { - SMSOTP( - context, - 1, - _selectedCountry['code'] + _mobileTextController.text, - (value) { - submit(model, value); - }, - () => { - Navigator.pop(context), - }, - ).displayDialog(context); - // showDialog( - // context: context, - // barrierDismissible: false, - // child: EReferralConfirmSMSDialog( - // phoneNumber: _selectedCountry['code'] + _mobileTextController.text, - // onSucces: () { - // Navigator.of(context).pop(); - // widget.changePageViewIndex(1); - // widget.createEReferralRequestModel.requesterName = - // _nameTextController.text; - // widget.createEReferralRequestModel.requesterContactNo = - // _selectedCountry['code'].toString().substring(1) + - // _mobileTextController.text; - // widget.createEReferralRequestModel.requesterRelationship = - // _selectedRelation.iD; - // }), - // ).then((value) { - // print("dialog dismissed"); - // print(value); - // if (value != null && value) {} - // }); - } return BaseView( onModelReady: (model) => model.getRelationTypes(), @@ -205,6 +186,10 @@ class _NewEReferralStepOnePageState extends State { await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: model.error); + showSMSDialog(model); + }); } else { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart index 85ea80e6..1eaf9875 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart @@ -42,7 +42,7 @@ class _ReferralDetailsState extends State { Container( margin: EdgeInsets.only(bottom: 10.0), child: Text( - TranslationBase.of(context).referralDetails, + TranslationBase.of(context).ereferral, style: TextStyle( letterSpacing: -0.64, color: Colors.black, @@ -116,7 +116,7 @@ class _ReferralDetailsState extends State { ), Expanded( child: _getNormalText( - DateUtil.getMonthDayYearDateFormatted( + DateUtil.getDayMonthYearDateFormatted( DateUtil.convertStringToDateNoTimeZone( widget.referral.referralDate)), isBold: true), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 513eb3b2..356e8eb1 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -172,7 +172,7 @@ class _SearchForReferralsPageState extends State { child: myRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)), myRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic), myRichText(TranslationBase.of(context).referralDate + ": ", - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic), ], ), Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined), diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 2c278f5e..84af56d6 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -175,7 +175,7 @@ class _BookSuccessState extends State { ), height: 45.0, child: RaisedButton( - color: new Color(0xFF60686b), + color: CustomColors.green, textColor: Colors.white, disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), @@ -365,10 +365,11 @@ class _BookSuccessState extends State { ), ], ), - Container( - margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), - child: Image.asset("assets/images/new-design/payment-method.png"), - ), + // Container( + // margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), + // child: Image.asset("assets/images/new-design/payment-method.png"), + // ), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), ], ); } @@ -447,10 +448,7 @@ class _BookSuccessState extends State { fontSize: 12.0, letterSpacing: -0.36, )), - Container( - margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), - child: Image.asset("assets/images/new-design/payment-method.png"), - ), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), Text( TranslationBase.of(context).payNowBookSuccesstext2, overflow: TextOverflow.clip, diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 81ba1285..f31aa53e 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -262,10 +262,7 @@ class _CovidPaymentDetailsState extends State { letterSpacing: -0.46, ), ), - Container( - margin: EdgeInsets.only(top: 12, bottom: 12), - child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300), - ), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), ], ), ), diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index c47c8d36..c5bcb23b 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -13,6 +13,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/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; @@ -95,9 +96,9 @@ class _CovidPaymentSummaryState extends State { decoration: containerColorRadiusBorderWidth(CustomColors.accentColor, 200, Colors.white, 4), ), Container( - height: 60.0, + height: 100.0, padding: EdgeInsets.all(7.0), - child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)), + child: Image.asset(getImagePath(widget.selectedPaymentMethod), width: 100, height: 100), ), mFlex(1), InkWell( @@ -154,17 +155,16 @@ class _CovidPaymentSummaryState extends State { ), ), bottomSheet: Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.1, + color: Theme.of(context).scaffoldBackgroundColor, + margin: EdgeInsets.only(bottom: 5.0), width: double.infinity, padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: CustomColors.green, - label: TranslationBase.of(context).confirm.toUpperCase(), - onTap: () { + child: DefaultButton( + TranslationBase.of(context).confirm.toUpperCase(), + () { startPaymentProcess(projectViewModel.user); }, + color: CustomColors.green, ), ), ); @@ -335,25 +335,25 @@ class _CovidPaymentSummaryState extends State { String getImagePath(String paymentMethod) { switch (paymentMethod) { case "MADA": - return 'assets/images/new-design/mada.png'; - break; - case "SADAD": - return 'assets/images/new-design/sadad.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'; + return 'assets/images/new/payment/Mada.png'; } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index a143fa15..1a0ec103 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -57,6 +57,8 @@ class _ToDoState extends State { ToDoCountProviderModel toDoProvider; CountdownTimerController controller; + ProjectViewModel projectViewModel; + @override void initState() { widget.patientShareResponse = new PatientShareResponse(); @@ -73,7 +75,7 @@ class _ToDoState extends State { @override Widget build(BuildContext context) { toDoProvider = Provider.of(context); - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, @@ -169,12 +171,12 @@ class _ToDoState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, - style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: 1.0)), + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)), if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n") Container( margin: EdgeInsets.only(top: 3.0, bottom: 3.0), child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(), - style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)), + style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -267,7 +269,7 @@ class _ToDoState extends State { color: Color(0xff20bc44), ), height: 30.0, - padding: EdgeInsets.only(right: 15), + padding: EdgeInsets.only(right: 10, left: 10), margin: EdgeInsets.symmetric(horizontal: 20), transform: Matrix4.translationValues(0.0, -8.0, 0.0), child: Row( @@ -319,11 +321,11 @@ class _ToDoState extends State { break; case 15: - return widget.languageID == 'ar' ? "assets/images/new-design/pay_online_button_arabic_disabled.png" : "assets/images/new-design/pay_online_button_disabled.png"; + return projectViewModel.isArabic ? "assets/images/new-design/pay_online_button_arabic_disabled.png" : "assets/images/new-design/pay_online_button_disabled.png"; break; case 20: - return widget.languageID == 'ar' ? "assets/images/new-design/pay_online_button_arabic.png" : "assets/images/new-design/pay_online_button.png"; + return projectViewModel.isArabic ? "assets/images/new-design/pay_online_button_arabic.png" : "assets/images/new-design/pay_online_button.png"; break; case 30: diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index f2a96651..3e7678cc 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -60,7 +60,7 @@ class _PaymentMethodState extends State { height: 60.0, width: 60, padding: EdgeInsets.all(7.0), - child: Image.asset("assets/images/new-design/mada.png"), + child: Image.asset("assets/images/new/payment/Mada.png"), ), mWidth(12), Text( @@ -96,7 +96,7 @@ class _PaymentMethodState extends State { height: 60.0, padding: EdgeInsets.all(7.0), width: 60, - child: Image.asset("assets/images/new-design/visa.png"), + child: Image.asset("assets/images/new/payment/visa.png"), ), mWidth(12), Text( @@ -132,7 +132,7 @@ class _PaymentMethodState extends State { height: 60.0, padding: EdgeInsets.all(7.0), width: 60, - child: Image.asset("assets/images/new-design/mastercard.png"), + child: Image.asset("assets/images/new/payment/Mastercard.png"), ), mWidth(12), Text( @@ -168,7 +168,7 @@ class _PaymentMethodState extends State { height: 60.0, padding: EdgeInsets.all(7.0), width: 60, - child: Image.asset("assets/images/new-design/installment.png"), + child: Image.asset("assets/images/new/payment/installments.png"), ), mWidth(12), Text( @@ -205,7 +205,7 @@ class _PaymentMethodState extends State { height: 60.0, padding: EdgeInsets.all(7.0), width: 60, - child: SvgPicture.asset("assets/images/new-design/applepay.svg"), + child: Image.asset("assets/images/new/payment/Apple_Pay.png"), ), mWidth(12), Text( diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index 7c461815..c46535b3 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; class PaymentDialog extends StatefulWidget { @@ -21,159 +23,106 @@ class _PaymentDialogState extends State { Widget build(BuildContext context) { return Container( child: Dialog( - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), child: Container( height: 550.0, width: 450.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: Text("Invoice Detail", - style: TextStyle( - fontSize: 25.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans-Bold")), - ), - Divider( - color: Colors.grey, - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text("Appointment Details", - style: TextStyle( - fontSize: 15.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans-Bold")), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text( - widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, - style: TextStyle( - color: Colors.grey[700], - fontSize: 15.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans-Bold")), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(getDate(widget.appo.appointmentDate), - style: getTextStyle()), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(widget.appo.projectName, style: getTextStyle()), - ), - Divider( - color: Colors.grey, - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), - child: Table( - children: [ - TableRow(children: [ - TableCell( - child: _getNormalText( - TranslationBase.of(context).patientShareToDo)), - TableCell( - child: _getNormalText(widget - .patientShareResponse.patientShare - .toString())), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText( - TranslationBase.of(context).patientTaxToDo)), - TableCell( - child: _getNormalText(widget - .patientShareResponse.patientTaxAmount - .toString())), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText(TranslationBase.of(context) - .patientShareTotalToDo)), - TableCell( - child: _getNormalText(widget - .patientShareResponse.patientShareWithTax - .toString())), - ]), - ], - ), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: Text("You can pay by following options: ", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans")), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), - child: Image.asset( - "assets/images/new-design/payment_options_invoice_confirmation.png", - width: 300), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 15.0), - child: Text( - "Are You Sure You Want To Make payment for this Appointment?", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14.0, - color: Colors.red[700], - fontFamily: "Open-Sans")), - ), - Divider( - color: Colors.grey, - ), - Container( - alignment: Alignment.center, - height: 40.0, - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: InkWell( - onTap: () { - Navigator.pop(context, null); - }, - child: Container( - child: Text("Cancel", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, color: Colors.red[700])), - ), - ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ + Container( + margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), + child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold)), + ), + Divider( + color: Colors.grey, + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text(TranslationBase.of(context).appoDetails, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.grey[700], fontSize: 15.0, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + child: Text(widget.appo.projectName, style: getTextStyle()), + ), + Divider( + color: Colors.grey, + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), + child: Table( + children: [ + TableRow(children: [ + TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), + TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), + ]), + TableRow(children: [ + TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), + TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())), + ]), + TableRow(children: [ + TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)), + TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())), + ]), + ], + ), + ), + Divider( + color: Colors.grey, + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), + child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), + ), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), + Container( + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 15.0), + child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor)), + ), + Divider( + color: Colors.grey, + ), + Container( + alignment: Alignment.center, + height: 40.0, + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, null); + }, + child: Container( + child: Text(TranslationBase.of(context).cancel, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, color: CustomColors.accentColor)), ), - Expanded( - child: InkWell( - onTap: () { - Navigator.pop(context, widget.patientShareResponse); + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.pop(context, widget.patientShareResponse); // widget.onPaymentMethodSelected(); - }, - child: Container( - child: Text("Ok", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - )), - ), - ), + }, + child: Container( + child: Text(TranslationBase.of(context).ok, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + )), ), - ], + ), ), - ), - ]), + ], + ), + ), + ]), ), ), ); @@ -182,19 +131,12 @@ class _PaymentDialogState extends State { _getNormalText(text) { return Container( margin: EdgeInsets.only(top: 10.0, right: 10.0), - child: Text(text, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 15, - fontFamily: 'Open-Sans', - letterSpacing: 0.5, - color: Colors.grey[700])), + child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), ); } TextStyle getTextStyle() { - return TextStyle( - color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold"); + return TextStyle(color: Colors.grey[700], fontSize: 13.0); } // Future navigateToPaymentMethod(context) async { diff --git a/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart b/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart index 30c273ae..a8950e5d 100644 --- a/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart +++ b/lib/pages/livecare/widgets/LiveCarePaymentDialog.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -38,7 +39,7 @@ class _LiveCarePaymentDialogState extends State { child: Container( height: 600.0, margin: EdgeInsets.all(20.0), - width: 450.0, + width: 500.0, child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -81,10 +82,8 @@ class _LiveCarePaymentDialogState extends State { ], ), Container( - alignment: Alignment.center, margin: EdgeInsets.only(bottom: 10.0, top: 10.0), child: Text(widget.clinicName, - textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), @@ -194,21 +193,13 @@ class _LiveCarePaymentDialogState extends State { color: Colors.grey[400], ), Container( - alignment: Alignment.center, margin: EdgeInsets.only(top: 10.0), child: new Text( TranslationBase.of(context).upComingPayOption, - textAlign: TextAlign.center, style: new TextStyle(fontSize: 14.0), ), ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), - child: Image.asset( - "assets/images/new-design/payment_options_invoice_confirmation.png", - width: 300), - ), + Container(margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), child: getPaymentMethods()), Divider( thickness: 1.0, color: Colors.grey[400], @@ -272,10 +263,9 @@ class _LiveCarePaymentDialogState extends State { return Container( margin: EdgeInsets.only(top: 10.0, right: 10.0), child: Text(text, - textAlign: TextAlign.end, + textAlign: TextAlign.start, style: TextStyle( fontSize: 14, - // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', letterSpacing: 0.5, color: Colors.black)), ); @@ -285,10 +275,9 @@ class _LiveCarePaymentDialogState extends State { return Container( margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0), child: Text(text, - textAlign: TextAlign.end, + textAlign: TextAlign.start, style: TextStyle( fontSize: 14, - // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', letterSpacing: 0.5, fontWeight: FontWeight.bold, color: Colors.black)), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 87dd7d2b..3e2ba0cf 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; 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/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; @@ -439,7 +440,7 @@ class _clinic_listState extends State { isDataLoaded ? Container( height: MediaQuery.of(context).size.height * 0.7, - child: Column( + child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0 ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ ListView.builder( @@ -465,7 +466,7 @@ class _clinic_listState extends State { height: 10.0, ), ], - ), + ): getNoDataWidget(context), ) : Container(), isDataLoaded diff --git a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart index e081e32b..fd4f8b26 100644 --- a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart +++ b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart @@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -77,9 +76,11 @@ class PrescriptionOrderOverview extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Text(prescriptionReportList[index].itemDescription.isNotEmpty - ? prescriptionReportList[index].itemDescription - : prescriptionReportList[index].itemDescriptionN)), + child: Text( + prescriptionReportList[index].itemDescription.isNotEmpty + ? prescriptionReportList[index].itemDescription + : prescriptionReportList[index].itemDescriptionN, + style: TextStyle(fontFamily: prescriptionReportList[index].itemDescription.isNotEmpty ? 'Poppins' : 'Cairo'))), )), ], ), @@ -130,7 +131,16 @@ class PrescriptionOrderOverview extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(prescriptionReportEnhList[index].itemDescription), + Text( + (prescriptionReportList[index].itemDescription.isNotEmpty + ? prescriptionReportList[index].itemDescription + : prescriptionReportList[index].itemDescriptionN ?? ''), + style: TextStyle( + fontFamily: prescriptionReportList[index].itemDescription.isNotEmpty ? 'Poppins' : 'Cairo', + letterSpacing: -0.64, + color: Color(0xff2E303A), + fontSize: 16.0, + fontWeight: FontWeight.w600)), ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0a3177e0..d663881f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2361,6 +2361,14 @@ class TranslationBase { String get selectSlot => localizedValues["selectSlot"][locale.languageCode]; + String get invoiceDetails => localizedValues["invoiceDetails"][locale.languageCode]; + + String get appoDetails => localizedValues["appoDetails"][locale.languageCode]; + + String get appoPaymentConfirm => localizedValues["appoPaymentConfirm"][locale.languageCode]; + + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 0bbad901..e9d70a1f 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -26,6 +26,22 @@ Color getColorFromHex(String hexColor) { return Color(int.parse(hexColor, radix: 16)); } +Widget getPaymentMethods() { + return Container( + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset("assets/images/new/payment/Mada.png", width: 50, height: 50), + Image.asset("assets/images/new/payment/visa.png", width: 50, height: 50), + Image.asset("assets/images/new/payment/Mastercard.png", width: 50, height: 50), + Image.asset("assets/images/new/payment/Apple_Pay.png", width: 50, height: 50), + Image.asset("assets/images/new/payment/installments.png", width: 50, height: 50), + ], + ), + ); +} + Widget getNoDataWidget(BuildContext context) { return Container( child: Center( diff --git a/pubspec.yaml b/pubspec.yaml index c5541181..c9de653d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -244,6 +244,7 @@ flutter: - assets/images/new/bottom_nav/ - assets/images/new/services/ - assets/images/new/appointment-rating/ + - assets/images/new/payment/ fonts: - family: WorkSans From 1223ab7a17137020ee70b2c562c0ea933a6920dd Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 13 Oct 2021 14:25:42 +0300 Subject: [PATCH 07/33] h20 week & month graph updated & improvements. --- lib/config/config.dart | 4 +- .../AlHabibMedicalService/H2O_view_model.dart | 31 ++- .../AlHabibMedicalService/h2o/h2o_page.dart | 184 ++++++------------ .../AlHabibMedicalService/h2o/month_page.dart | 63 +++--- .../AlHabibMedicalService/h2o/week_page.dart | 66 +++---- .../medical/vital_sign/vital_sign_item.dart | 3 +- lib/widgets/charts/custom_line_chart.dart | 148 ++++++++++++++ lib/widgets/others/app_scaffold_widget.dart | 8 +- 8 files changed, 311 insertions(+), 196 deletions(-) create mode 100644 lib/widgets/charts/custom_line_chart.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 7840b97d..d7ffabcd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// 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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index 219103da..3e980071 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -9,14 +9,19 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_p import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart'; import '../../../locator.dart'; class H2OViewModel extends BaseViewModel { H2OService _h2OService = locator(); - List userProgressForWeekDataSeries; - List userProgressForMonthDataSeries; + // + // List userProgressForWeekDataSeries; + List userProgressForWeekDataSeries; + List userProgressForMonthDataSeries; + + // List userProgressForMonthDataSeries; UserDetailModel get userDetail => _h2OService.userDetailModel; @@ -71,7 +76,8 @@ class H2OViewModel extends BaseViewModel { error = _h2OService.error; setState(ViewState.Error); } else { - userProgressForWeekDataSeries = createUserProgressForWeekDataSeries(); + // userProgressForWeekDataSeries = createUserProgressForWeekDataSeries(); + userProgressForWeekDataSeries = createUserProgressForWeekDataSeriesNew(); setState(ViewState.Idle); } } @@ -83,7 +89,7 @@ class H2OViewModel extends BaseViewModel { error = _h2OService.error; setState(ViewState.Error); } else { - userProgressForMonthDataSeries = createUserProgressForMonthDataSeries(); + userProgressForMonthDataSeries = createUserProgressForMonthDataSeriesNew(); setState(ViewState.Idle); } } @@ -113,6 +119,23 @@ class H2OViewModel extends BaseViewModel { ]; } + List createUserProgressForWeekDataSeriesNew() { + List list = []; + + _h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) { + list.add(new LineChartModel(data.dayName, data.percentageConsumed)); + }); + return list; + } + + List createUserProgressForMonthDataSeriesNew() { + List list = []; + _h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) { + list.add(new LineChartModel(data.monthName, data.percentageConsumed)); + }); + return list; + } + List> createUserProgressForMonthDataSeries() { List globalData = []; _h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) { diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 982b9044..69488bfe 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -77,132 +77,70 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { }, ), ], - body: Scaffold( - // extendBodyBehindAppBar: true, - // appBar: PreferredSize( - // preferredSize: Size.fromHeight(65.0), - // child: Stack( - // children: [ - // Positioned( - // bottom: 1, - // left: 0, - // right: 0, - // child: BackdropFilter( - // filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - // child: Container( - // color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), - // height: 70.0, - // ), - // ), - // ), - // Center( - // child: Container( - // height: 60.0, - // alignment: Alignment.center, - // // margin: EdgeInsets.only(top: 10.0), - // // width: MediaQuery.of(context).size.width * 0.9, - // - // child: TabBar( - // isScrollable: false, - // controller: _tabController, - // indicatorWeight: 5.0, - // indicatorSize: TabBarIndicatorSize.tab, - // indicatorColor: Colors.red[800], - // labelColor: Theme.of(context).primaryColor, - // labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), - // unselectedLabelColor: Colors.grey[800], - // tabs: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.28, - // child: Center( - // child: Texts(TranslationBase.of(context).today), - // ), - // ), - // Container( - // width: MediaQuery.of(context).size.width * 0.28, - // child: Center( - // child: Texts(TranslationBase.of(context).week), - // ), - // ), - // Container( - // width: MediaQuery.of(context).size.width * 0.28, - // child: Center( - // child: Texts(TranslationBase.of(context).month), - // ), - // ), - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // backgroundColor: Colors.white, - body: Column( - children: [ - TabBar( + body: Column( + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)], + ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), controller: _tabController, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Color(0xff2B353E), - unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - labelStyle: TextStyle( - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - unselectedLabelStyle: TextStyle( - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)], + children: [TodayPage(), WeekPage(), MonthPage()], ), - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [TodayPage(), WeekPage(), MonthPage()], - ), - ) - ], - ), - bottomNavigationBar: BottomNavBar( - changeIndex: (index) { - if (index == 0) { - IS_VOICE_COMMAND_CLOSED = false; - } else if (index == 1) { - Navigator.push( - context, - FadePage( - page: AppScaffold( - appBarTitle: TranslationBase.of(context).medicalProfile, - isShowAppBar: true, - showHomeAppBarIcon: false, - appBarIcons: [ - IconButton( - icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), - color: Colors.white, - onPressed: () => Navigator.of(context).pushNamed( - SETTINGS, - ), + ) + ], + ), + bottomNavigationBar: BottomNavBar( + changeIndex: (index) { + if (index == 0) { + IS_VOICE_COMMAND_CLOSED = false; + } else if (index == 1) { + Navigator.push( + context, + FadePage( + page: AppScaffold( + appBarTitle: TranslationBase.of(context).medicalProfile, + isShowAppBar: true, + showHomeAppBarIcon: false, + appBarIcons: [ + IconButton( + icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), + color: Colors.white, + onPressed: () => Navigator.of(context).pushNamed( + SETTINGS, ), - ], - body: MedicalProfilePageNew()))); - } else if (index == 2) { - Navigator.of(context).pushNamedAndRemoveUntil(HOME, (Route route) => false); - } else if (index == 3) { - Navigator.of(context).pushNamed(MY_FAMILIY); - } else if (index == 4) { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false))); - } - }, - showHomeIcon: true, - index: 0, - ), + ), + ], + body: MedicalProfilePageNew()))); + } else if (index == 2) { + Navigator.of(context).pushNamedAndRemoveUntil(HOME, (Route route) => false); + } else if (index == 3) { + Navigator.of(context).pushNamed(MY_FAMILIY); + } else if (index == 4) { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false))); + } + }, + showHomeIcon: true, + index: 0, ), ), ); diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index 8867fb77..daf91cb9 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -6,10 +6,11 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart'; class MonthPage extends StatelessWidget { @override @@ -21,37 +22,39 @@ class MonthPage extends StatelessWidget { isShowAppBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, - body: Padding( - padding: EdgeInsets.all(8.0), - child: ListView( - children: [ - Center( - child: Text( - TranslationBase.of(context).waterConsumedInMonth, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 20.0, color: Colors.black87), - ), - ), - SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 10, - width: 40, - color: Colors.blue, + body: SingleChildScrollView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + child: (model.userProgressForMonthDataSeries ?? []).isEmpty + ? getNoDataWidget(context) + : Container( + padding: EdgeInsets.fromLTRB(16, 14, 16, 14), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], ), - SizedBox(width: 8), - Text( - TranslationBase.of(context).waterConsumedInMonth, - style: TextStyle(fontSize: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + TranslationBase.of(context).waterConsumedInMonth, + style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64), + ), + SizedBox(height: 24), + CustomLineChart(model.userProgressForMonthDataSeries, projectViewModel.isArabic), + ], ), - ], - ), - // SizedBox(height: 8), - AppBarChart(seriesList: model.userProgressForMonthDataSeries, isArabic: projectViewModel.isArabic), - ], - ), + ), ), ), ); diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index 6f4423b2..83529afd 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -1,12 +1,10 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; -import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -21,37 +19,39 @@ class WeekPage extends StatelessWidget { isShowAppBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, - body: Padding( - padding: EdgeInsets.all(8.0), - child: ListView( - children: [ - Center( - child: Text( - TranslationBase.of(context).waterConsumedInWeek, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 20.0, color: Colors.black87), - ), - ), - SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 10, - width: 40, - color: Colors.blue, + body: SingleChildScrollView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + child: (model.userProgressForWeekDataSeries ?? []).isEmpty + ? getNoDataWidget(context) + : Container( + padding: EdgeInsets.fromLTRB(16, 14, 16, 14), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], ), - SizedBox(width: 8), - Text( - TranslationBase.of(context).waterConsumedInWeek, - style: TextStyle(fontSize: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + TranslationBase.of(context).waterConsumedInWeek, + style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64), + ), + SizedBox(height: 24), + CustomLineChart(model.userProgressForWeekDataSeries, projectViewModel.isArabic), + ], ), - ], - ), - // SizedBox(height: 8), - AppBarChart(seriesList: model.userProgressForWeekDataSeries,isArabic: projectViewModel.isArabic), - ], - ), + ), ), ), ); diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart index 37cbbf27..1549db39 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -42,6 +42,7 @@ class VitalSignItem extends StatelessWidget { maxLines: 1, style: TextStyle( fontSize: 15, + color: Color(0xff2B353E), letterSpacing: -0.45, fontWeight: FontWeight.bold, ), @@ -64,7 +65,7 @@ class VitalSignItem extends StatelessWidget { height: MediaQuery.of(context).size.width / 16, child: SvgPicture.asset( vitalSign.icon, - color: Colors.black, + color: Color(0xff2E303A), ), ), ], diff --git a/lib/widgets/charts/custom_line_chart.dart b/lib/widgets/charts/custom_line_chart.dart new file mode 100644 index 00000000..cfd1e718 --- /dev/null +++ b/lib/widgets/charts/custom_line_chart.dart @@ -0,0 +1,148 @@ +import 'dart:math' as math; + +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartModel { + int value; + String title; + + LineChartModel(this.title, this.value); +} + +class CustomLineChart extends StatefulWidget { + final List list; + final bool isArabic; + CustomLineChart(this.list, this.isArabic); + + @override + _CustomLineChartState createState() => _CustomLineChartState(); +} + +class _CustomLineChartState extends State { + bool showAvg = false; + + final List myList = [ + LineChartModel("", 0), + LineChartModel("", 0), + // LineChartModel("", 0), + ]; + + List list = []; + + @override + void initState() { + super.initState(); + if (widget.list.isEmpty) { + list = myList; + } else { + list = widget.list; + } + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + AspectRatio( + aspectRatio: 1.0, + child: LineChart( + mainData(), + ), + ), + SizedBox( + width: 60, + height: 34, + child: TextButton( + onPressed: () { + setState(() { + showAvg = !showAvg; + }); + }, + child: Text( + '', + style: TextStyle(fontSize: 12, color: showAvg ? Colors.white.withOpacity(0.5) : Colors.white), + ), + ), + ), + ], + ); + } + + LineChartData mainData() { + SideTitles right = SideTitles( + showTitles: true, + margin: 0, + reservedSize: 8, + getTitles: (value) { + return ''; + }, + ); + SideTitles left = SideTitles( + showTitles: true, + interval: 1, + getTextStyles: (value) => const TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: 0), + getTitles: (value) { + if (widget.list.isEmpty) { + return (value).toInt().toString(); + } + return (value * 20).toInt().toString(); + }, + reservedSize: 22, + margin: 12, + ); + return LineChartData( + lineTouchData: LineTouchData(enabled: false), + gridData: FlGridData( + show: true, + drawVerticalLine: false, + getDrawingHorizontalLine: (value) { + return FlLine( + color: const Color(0xffEFEFEF), + strokeWidth: 1, + ); + }, + ), + titlesData: FlTitlesData( + show: true, + topTitles: SideTitles(showTitles: false), + bottomTitles: SideTitles( + showTitles: true, + reservedSize: 22, + interval: 1, + getTextStyles: (value) => const TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: 0), + getTitles: (value) { + String _title = list[value.toInt()].title; + return (_title.length > 3 ? (widget.isArabic ? _title : _title.substring(0, 3)) : _title).toUpperCase(); + }, + margin: 12, + ), + rightTitles: widget.isArabic ? left : right, + leftTitles: widget.isArabic ? right : left), + borderData: FlBorderData( + show: true, + border: Border.symmetric( + horizontal: BorderSide(color: const Color(0xffEFEFEF), width: 1), + ), + ), + minX: 0, + maxX: widget.list.isEmpty ? 1 : widget.list.length - 1.0, + minY: widget.list.isEmpty ? -1 : 0, + maxY: widget.list.isEmpty ? 1 : 5, + lineBarsData: [ + LineChartBarData( + spots: [ + for (int i = 0; i < list.length; i++) FlSpot(i + 0.0, (list[i].value / 20) + 0.0), + ], + isCurved: true, + preventCurveOverShooting: true, + barWidth: 2, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + ), + ], + ); + } +} diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 5d4e3704..a0f95c1d 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -28,6 +28,7 @@ class AppScaffold extends StatelessWidget { final String appBarTitle; final Widget body; final Widget bottomSheet; + final Widget bottomNavigationBar; final bool isLoading; final bool isShowAppBar; final bool showNewAppBar; @@ -70,6 +71,7 @@ class AppScaffold extends StatelessWidget { this.showNewAppBarTitle = false, this.hasAppBarParam, this.bottomSheet, + this.bottomNavigationBar, this.baseViewModel, this.floatingActionButton, this.isPharmacy = false, @@ -118,7 +120,7 @@ class AppScaffold extends StatelessWidget { dropDownList: dropDownList ?? [], dropDownIndexChange: dropDownIndexChange, appBarIcons: appBarIcons, - onTap: onTap, + onTap: onTap, ) : (isShowAppBar ? appBar = AppBarWidget( @@ -151,6 +153,7 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(context), ), + bottomNavigationBar: bottomNavigationBar, floatingActionButton: floatingActionButton, ); } @@ -174,8 +177,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { final List appBarIcons; Function onTap; - NewAppBarWidget( - {Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap}) + NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap}) : super(key: key); @override From 21863cfe06e777c68289415638ef68257de7ce4c Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 13 Oct 2021 14:51:22 +0300 Subject: [PATCH 08/33] improvements. --- .../AlHabibMedicalService/h2o/h2o_page.dart | 5 + .../medical/balance/advance_payment_page.dart | 396 +++++++++--------- 2 files changed, 208 insertions(+), 193 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index ef2bc2e9..d216cd21 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -8,8 +9,12 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 9e587b7f..338aff23 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -67,70 +67,38 @@ class _AdvancePaymentPageState extends State { return BaseView( onModelReady: (model) => model.getHospitals(), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - imagesInfo: imagesInfo, - appBarTitle: TranslationBase.of(context).advancePayment, - description: TranslationBase.of(context).infoAdvancePayment, - showNewAppBarTitle: true, - showNewAppBar: true, - backgroundColor: CustomColors.appBackgroudGreyColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).advancePaymentLabel, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.46, - ), - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectBeneficiaryDialog(model), - child: Container( - padding: EdgeInsets.all(8), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - getBeneficiaryType(), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.46, - ), - ), - Icon(Icons.arrow_drop_down) - ], + isShowAppBar: true, + imagesInfo: imagesInfo, + appBarTitle: TranslationBase.of(context).advancePayment, + description: TranslationBase.of(context).infoAdvancePayment, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + TranslationBase.of(context).advancePaymentLabel, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, ), ), - ), - if (beneficiaryType == BeneficiaryType.MyFamilyFiles) SizedBox( height: 12, ), - if (beneficiaryType == BeneficiaryType.MyFamilyFiles) InkWell( - onTap: () { - GifLoaderDialogUtils.showMyDialog(context); - model.getFamilyFiles().then((value) { - GifLoaderDialogUtils.hideDialog(context); - confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList); - }); - }, + onTap: () => confirmSelectBeneficiaryDialog(model), child: Container( - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(8), width: double.infinity, height: 65, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), @@ -138,42 +106,102 @@ class _AdvancePaymentPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - getFamilyMembersName(), + getBeneficiaryType(), style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46, ), ), - Icon(Icons.arrow_drop_down), + Icon(Icons.arrow_drop_down) ], ), ), ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).fileNumber, - controller: _fileTextController, - readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true, - ), - if (beneficiaryType == BeneficiaryType.OtherAccount) + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + InkWell( + onTap: () { + GifLoaderDialogUtils.showMyDialog(context); + model.getFamilyFiles().then((value) { + GifLoaderDialogUtils.hideDialog(context); + confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList); + }); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + getFamilyMembersName(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Icon(Icons.arrow_drop_down), + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + controller: _fileTextController, + readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + InkWell( + onTap: () { + if (_fileTextController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) { + GifLoaderDialogUtils.hideDialog(context); + confirmSelectPatientDialog(model.patientInfoList); + }); + } else + AppToast.showErrorToast(message: 'Please Enter The File Number'); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + getPatientName(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Icon(Icons.arrow_drop_down), + ], + ), + ), + ), SizedBox( height: 12, ), - if (beneficiaryType == BeneficiaryType.OtherAccount) InkWell( - onTap: () { - if (_fileTextController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) { - GifLoaderDialogUtils.hideDialog(context); - confirmSelectPatientDialog(model.patientInfoList); - }); - } else - AppToast.showErrorToast(message: 'Please Enter The File Number'); - }, + onTap: () => confirmSelectHospitalDialog(model.hospitals), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -183,7 +211,7 @@ class _AdvancePaymentPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - getPatientName(), + getHospitalName(), style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -195,132 +223,114 @@ class _AdvancePaymentPageState extends State { ), ), ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectHospitalDialog(model.hospitals), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - getHospitalName(), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.46, - ), - ), - Icon(Icons.arrow_drop_down), - ], - ), + SizedBox( + height: 12, ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).amount, - keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), - onChanged: (value) { - setState(() { - amount = value; - }); - }, - ), - SizedBox( - height: 12, - ), - if (model.user != null) NewTextFields( - hintText: TranslationBase.of(context).depositorEmail, - initialValue: model.user.emailAddress, + hintText: TranslationBase.of(context).amount, + keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), onChanged: (value) { - email = value; + setState(() { + amount = value; + }); }, ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).notes, - controller: _notesTextController, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.15, - ) - ], + SizedBox( + height: 12, + ), + if (model.user != null) + NewTextFields( + hintText: TranslationBase.of(context).depositorEmail, + initialValue: model.user.emailAddress, + onChanged: (value) { + email = value; + }, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).notes, + controller: _notesTextController, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), ), ), - ), - bottomSheet: Container( - width: double.infinity, - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(12), - child: DefaultButton( - TranslationBase.of(context).submit, - (amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null) ? null : - () { - var mobileNum; - var patientName; + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).submit, + (amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null) + ? null + : () { + var mobileNum; + var patientName; - if (beneficiaryType == BeneficiaryType.MyFamilyFiles) { - mobileNum = selectedPatientFamily.mobileNumber; - patientName = selectedPatientFamily.patientName; - } - - if (beneficiaryType == BeneficiaryType.MyAccount) { - mobileNum = model.user.mobileNumber; - patientName = model.user.firstName; - } + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) { + mobileNum = selectedPatientFamily.mobileNumber; + patientName = selectedPatientFamily.patientName; + } - if (beneficiaryType == BeneficiaryType.OtherAccount) { - mobileNum = _selectedPatientInfo.mobileNumber; - patientName = _selectedPatientInfo.fullName; - } + if (beneficiaryType == BeneficiaryType.MyAccount) { + mobileNum = model.user.mobileNumber; + patientName = model.user.firstName; + } - advanceModel.fileNumber = _fileTextController.text; - advanceModel.hospitalsModel = _selectedHospital; - advanceModel.note = _notesTextController.text; - advanceModel.email = email ?? model.user.emailAddress; - advanceModel.amount = amount; - advanceModel.mobileNumber = mobileNum; - advanceModel.patientName = patientName; - GifLoaderDialogUtils.showMyDialog(context); - model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { - Utils.hideKeyboard(context); - Navigator.push(context, FadePage(page: PaymentMethod( - onSelectedMethod: (String metohd) { - setState(() {}); + if (beneficiaryType == BeneficiaryType.OtherAccount) { + mobileNum = _selectedPatientInfo.mobileNumber; + patientName = _selectedPatientInfo.fullName; } - ))).then( - (value) { - Navigator.push( - context, - FadePage( - page: ConfirmPaymentPage( - advanceModel: advanceModel, - selectedPaymentMethod: value, - patientInfoAndMobileNumber: model.patientInfoAndMobileNumber, - authenticatedUser: authUser, - ), - ), - ); + + advanceModel.fileNumber = _fileTextController.text; + advanceModel.hospitalsModel = _selectedHospital; + advanceModel.note = _notesTextController.text; + advanceModel.email = email ?? model.user.emailAddress; + advanceModel.amount = amount; + advanceModel.mobileNumber = mobileNum; + advanceModel.patientName = patientName; + GifLoaderDialogUtils.showMyDialog(context); + model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { + Utils.hideKeyboard(context); + Navigator.push( + context, + FadePage( + page: PaymentMethod(onSelectedMethod: (String metohd) { + setState(() {}); + }), + ), + ).then( + (value) { + Navigator.push( + context, + FadePage( + page: ConfirmPaymentPage( + advanceModel: advanceModel, + selectedPaymentMethod: value, + patientInfoAndMobileNumber: model.patientInfoAndMobileNumber, + authenticatedUser: authUser, + ), + ), + ); + }, + ); + } + }); }, - ); - } - }); - }, - disabledColor: Colors.grey, + color: Color(0xffD02127), + textColor: Colors.white, + disabledColor: Color(0xffEAEAEA), + ), ), - )), + ], + ), + ), ); } From dde16a13fe3ec6f089bf5fd54f939bb5bc1de927 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Wed, 13 Oct 2021 15:36:40 +0300 Subject: [PATCH 09/33] General page in profile --- lib/config/localized_values.dart | 3 + .../all_habib_medical_service_page.dart | 9 +- lib/pages/settings/general_setting.dart | 432 ++++++++++-------- lib/pages/settings/profile_setting.dart | 2 +- lib/uitl/translations_delegate_base.dart | 4 + 5 files changed, 245 insertions(+), 205 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e34982a1..f16c395d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1499,4 +1499,7 @@ const Map localizedValues = { "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, "selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" }, "recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" }, + "modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" }, + "prefferedMode": { "en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه" }, + "permissionsBellow": { "en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه" }, }; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index b0b14f1d..ce3bde14 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -244,10 +244,7 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/emergency_service_image.png', title: TranslationBase.of(context).emergencyService, ), - ServicesContainer( - onTap: () => getPharmacyToken(), - imageLocation: 'assets/images/pharmacy_logo.png', - title: TranslationBase.of(context).pharmacy), + ServicesContainer(onTap: () => getPharmacyToken(), imageLocation: 'assets/images/pharmacy_logo.png', title: TranslationBase.of(context).pharmacy), ServicesContainer( onTap: () => Navigator.push( context, @@ -332,9 +329,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage( - page: SmartWatchInstructions() - ), + FadePage(page: SmartWatchInstructions()), ), imageLocation: 'assets/images/new-design/smartwatch_icon.png', title: TranslationBase.of(context).smartWatches, diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart index 049b9821..adbebfca 100644 --- a/lib/pages/settings/general_setting.dart +++ b/lib/pages/settings/general_setting.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,8 +18,7 @@ class GeneralSettings extends StatefulWidget { _GeneralSettings createState() => _GeneralSettings(); } -class _GeneralSettings extends State - with TickerProviderStateMixin { +class _GeneralSettings extends State with TickerProviderStateMixin { var themeNotifier; int blindValue = 0; bool vibration = false; @@ -28,6 +29,7 @@ class _GeneralSettings extends State var permission = new PermissionService(); LocationPermission locationPermission; var mediaQueryData; + @override void initState() { this.getValues(); @@ -38,196 +40,243 @@ class _GeneralSettings extends State mediaQueryData = MediaQuery.of(context); themeNotifier = Provider.of(context); return Container( - child: ListView(scrollDirection: Axis.vertical, children: [ - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context).modes, - fontWeight: FontWeight.bold, - ), - ), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).vibration), - Switch( - value: vibration, - onChanged: (value) { - setState(() { - vibration = value; - }); - setVibration(value); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).accessibility), - Switch( - value: accsibility, - onChanged: (value) { - setState(() { - accsibility = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context).blindMode, - fontWeight: FontWeight.bold, - ), - ), - new Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(8.0), - child: new Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - new Text( - TranslationBase.of(context).offTheme, - style: new TextStyle(fontSize: 16.0), - ), - Radio( - value: 0, - groupValue: blindValue, - onChanged: (value) { - setState(() => {this.blindValue = value}); - setTheme(value); - }, - ), - ], + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(21.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Text( + TranslationBase.of(context).alert, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + Text( + TranslationBase.of(context).modesBelow, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ), + Row( + children: [ + Checkbox( + value: vibration, + onChanged: (value) { + setState(() { + vibration = value; + }); + }, + activeColor: CustomColors.accentColor, + ), + Text( + TranslationBase.of(context).prefferedMode, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - new Text( - TranslationBase.of(context).invertTheme, - style: new TextStyle( - fontSize: 16.0, - ), - ), - new Radio( - value: 1, - groupValue: blindValue, - onChanged: (value) { - setState(() => {this.blindValue = value}); - setTheme(value); - }, - ) - ], + ), + ], + ), + Row( + children: [ + Checkbox( + value: accsibility, + onChanged: (value) { + setState(() { + accsibility = value; + }); + }, + activeColor: CustomColors.accentColor, + ), + Text( + TranslationBase.of(context).accessibility, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - new Text( - TranslationBase.of(context).dimTheme, - style: new TextStyle(fontSize: 16.0), + ), + ], + ), + mHeight(16), + mHeight(12), + Text( + TranslationBase.of(context).blindMode, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + Text( + TranslationBase.of(context).prefferedMode, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ), + Column( + children: [ + Row( + children: [ + new Radio( + value: 0, + groupValue: blindValue, + onChanged: (value) { + setState(() { + blindValue = value; + setTheme(value); + }); + }, + ), + Text( + TranslationBase.of(context).offTheme, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - new Radio( - value: 2, - groupValue: blindValue, - onChanged: (value) { - setState(() => {this.blindValue = value}); + ), + ], + ), + Row( + children: [ + Radio( + value: 1, + groupValue: blindValue, + onChanged: (value) { + setState(() { + blindValue = value; setTheme(value); - }, + }); + }, + ), + Text( + TranslationBase.of(context).invertTheme, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - new Text( - TranslationBase.of(context).bwTheme, - style: new TextStyle(fontSize: 16.0), + ), + ], + ), + Row( + children: [ + Radio( + value: 2, + groupValue: blindValue, + onChanged: (value) { + setState(() { + blindValue = value; + setTheme(value); + }); + }, + ), + Text( + TranslationBase.of(context).dimTheme, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - new Radio( - value: 3, - groupValue: blindValue, - onChanged: (value) { - setState(() => {this.blindValue = value}); - + ), + ], + ), + Row( + children: [ + Radio( + value: 1, + groupValue: blindValue, + onChanged: (value) { + setState(() { + blindValue = value; setTheme(value); - }, + }); + }, + ), + Text( + TranslationBase.of(context).bwTheme, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - ], + ), + ], + ), + ], + ), + mHeight(12), + mHeight(12), + Text( + TranslationBase.of(context).permissions, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + Text( + TranslationBase.of(context).permissionsBellow, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ), + Row( + children: [ + Checkbox( + value: camera, + onChanged: (value) { + setState(() { + camera = value; + }); + this.permission.openSettings(); + }, + activeColor: CustomColors.accentColor, + ), + Text( + TranslationBase.of(context).cameraPermission, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Checkbox( + value: location, + onChanged: (value) { + if (value == true) { + Navigator.pop(context); + this.setLocationPermission(); + } else { + Geolocator.openLocationSettings(); + } + }, + activeColor: CustomColors.accentColor, + ), + Text( + TranslationBase.of(context).locationPermission, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, ), - ], - ) - ])), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context).permissions, - fontWeight: FontWeight.bold, + ), + ], + ), + mHeight(16), + ], + ), ), ), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).cameraPermission), - Switch( - value: camera, - onChanged: (value) { - setState(() { - camera = value; - }); - this.permission.openSettings(); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).locationPermission), - Switch( - value: location, - onChanged: (value) { - if (value == true) { - Navigator.pop(context); - this.setLocationPermission(); - } else { - Geolocator.openLocationSettings(); - } - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )) - ])); + ); } setLocationPermission() async { @@ -292,11 +341,8 @@ class _GeneralSettings extends State getValues() async { if (permission.isThemeEnabled() != null) { - blindValue = - permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled(); - vibration = permission.isVibrationEnabled() == null - ? false - : permission.isVibrationEnabled(); + blindValue = permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled(); + vibration = permission.isVibrationEnabled() == null ? false : permission.isVibrationEnabled(); // accsibility = mediaQueryData.accessibleNavigation; //setTheme(blindValue); } @@ -310,19 +356,11 @@ class _GeneralSettings extends State getTheme(value) async { if (value == 1) { - return invertThemes( - fontName: Provider.of(context, listen: false).isArabic ? 'Cairo' : 'Poppins' - ); + return invertThemes(fontName: Provider.of(context, listen: false).isArabic ? 'Cairo' : 'Poppins'); } else if (value == 3) { - return bwThemes( - fontName: Provider.of(context, listen: false).isArabic ? 'Cairo' : 'Poppins' - ); + return bwThemes(fontName: Provider.of(context, listen: false).isArabic ? 'Cairo' : 'Poppins'); } else { - return defaultTheme( - fontName: - Provider.of(context, listen: false).isArabic - ? 'Cairo' - : 'Poppins'); + return defaultTheme(fontName: Provider.of(context, listen: false).isArabic ? 'Cairo' : 'Poppins'); } } } diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 1d2938cc..f55227d8 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -47,7 +47,7 @@ class _ProfileSettings extends State with TickerProviderStateMi Expanded( child: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.all(12.0), + padding: const EdgeInsets.all(21.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 48e8b0bd..a971531e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2364,6 +2364,10 @@ class TranslationBase { String get selectLanguage => localizedValues["selectLanguage"][locale.languageCode]; String get recAlert => localizedValues["recAlert"][locale.languageCode]; + + String get modesBelow => localizedValues["modesBelow"][locale.languageCode]; + String get prefferedMode => localizedValues["prefferedMode"][locale.languageCode]; + String get permissionsBellow => localizedValues["permissionsBellow"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 58c78656bf99dc1bb7b9be56f5d479887cec0e88 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 13 Oct 2021 15:44:38 +0300 Subject: [PATCH 10/33] Rating dialog updates --- .../new/{visa.png => paymentMethods.png} | Bin lib/config/config.dart | 4 +- .../AppoimentAllHistoryResultList.dart | 4 + lib/models/Appointments/DoctorProfile.dart | 4 + lib/models/header_model.dart | 3 +- lib/pages/BookAppointment/DoctorProfile.dart | 1 + .../MyAppointments/AppointmentDetails.dart | 5 +- .../fragments/home_page_fragment2.dart | 2 +- lib/widgets/new_design/doctor_header.dart | 282 +++++++++++------- 9 files changed, 188 insertions(+), 117 deletions(-) rename assets/images/new/{visa.png => paymentMethods.png} (100%) diff --git a/assets/images/new/visa.png b/assets/images/new/paymentMethods.png similarity index 100% rename from assets/images/new/visa.png rename to assets/images/new/paymentMethods.png diff --git a/lib/config/config.dart b/lib/config/config.dart index f12c9191..126cb034 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// 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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index 045f759e..f14e23d0 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -39,6 +39,7 @@ class AppoitmentAllHistoryResultList { String doctorImageURL; String doctorNameObj; int doctorRate; + double decimalDoctorRate; List doctorSpeciality; String doctorTitle; int gender; @@ -108,6 +109,7 @@ class AppoitmentAllHistoryResultList { this.doctorImageURL, this.doctorNameObj, this.doctorRate, + this.decimalDoctorRate, this.doctorSpeciality, this.doctorTitle, this.gender, @@ -176,6 +178,7 @@ class AppoitmentAllHistoryResultList { doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; doctorRate = json['DoctorRate']; + decimalDoctorRate = json['DecimalDoctorRate']; doctorSpeciality = json['DoctorSpeciality'] != null ? json['DoctorSpeciality'].cast() : ["null"]; @@ -250,6 +253,7 @@ class AppoitmentAllHistoryResultList { data['DoctorImageURL'] = this.doctorImageURL; data['DoctorNameObj'] = this.doctorNameObj; data['DoctorRate'] = this.doctorRate; + data['DecimalDoctorRate'] = this.decimalDoctorRate; data['DoctorSpeciality'] = this.doctorSpeciality; data['DoctorTitle'] = this.doctorTitle; data['Gender'] = this.gender; diff --git a/lib/models/Appointments/DoctorProfile.dart b/lib/models/Appointments/DoctorProfile.dart index 9b2bc8e9..df6031a7 100644 --- a/lib/models/Appointments/DoctorProfile.dart +++ b/lib/models/Appointments/DoctorProfile.dart @@ -35,6 +35,7 @@ class DoctorProfileList { int actualDoctorRate; String doctorImageURL; int doctorRate; + double decimalDoctorRate; String doctorTitleForProfile; bool isAppointmentAllowed; String nationalityFlagURL; @@ -79,6 +80,7 @@ class DoctorProfileList { this.actualDoctorRate, this.doctorImageURL, this.doctorRate, + this.decimalDoctorRate, this.doctorTitleForProfile, this.isAppointmentAllowed, this.nationalityFlagURL, @@ -123,6 +125,7 @@ class DoctorProfileList { actualDoctorRate = json['ActualDoctorRate']; doctorImageURL = json['DoctorImageURL']; doctorRate = json['DoctorRate']; + decimalDoctorRate = json['DecimalDoctorRate']; doctorTitleForProfile = json['DoctorTitleForProfile']; isAppointmentAllowed = json['IsAppointmentAllowed']; nationalityFlagURL = json['NationalityFlagURL']; @@ -169,6 +172,7 @@ class DoctorProfileList { data['ActualDoctorRate'] = this.actualDoctorRate; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorRate'] = this.doctorRate; + data['DecimalDoctorRate'] = this.decimalDoctorRate; data['DoctorTitleForProfile'] = this.doctorTitleForProfile; data['IsAppointmentAllowed'] = this.isAppointmentAllowed; data['NationalityFlagURL'] = this.nationalityFlagURL; diff --git a/lib/models/header_model.dart b/lib/models/header_model.dart index b1da8b17..1f4d14fc 100644 --- a/lib/models/header_model.dart +++ b/lib/models/header_model.dart @@ -11,8 +11,9 @@ class HeaderModel { int doctorRate; int actualDoctorRate; int totalReviews; + String decimalDoctorRate; String email; HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, - this.actualDoctorRate, this.totalReviews, this.email); + this.actualDoctorRate, this.totalReviews, this.email, {this.decimalDoctorRate = null}); } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index e71fa02b..5c2cb113 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -115,6 +115,7 @@ class _DoctorProfileState extends State with TickerProviderStateM widget.doctor.actualDoctorRate, widget.docProfileList.noOfPatientsRate, "", + decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(), ), buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index be44855d..57e2ea3b 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -106,6 +106,7 @@ class _AppointmentDetailsState extends State with SingleTick widget.appo.actualDoctorRate, widget.appo.noOfPatientsRate, "", + decimalDoctorRate: widget.appo.decimalDoctorRate.toString() //model.user.emailAddress, ), isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, @@ -326,12 +327,10 @@ class _AppointmentDetailsState extends State with SingleTick child: Column( children: [ Container( - alignment: Alignment.center, width: MediaQuery.of(context).size.width, - color: Theme.of(context).primaryColor, margin: EdgeInsets.only(bottom: 5.0), padding: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), + child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))), Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), Container( margin: EdgeInsets.only(top: 5.0), diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 669e14f9..c6807ebb 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -53,7 +53,7 @@ class _HomePageFragment2State extends State { hmgServices.clear(); hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "assets/images/new/emergency.svg", isLogin)); diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index b3b7685a..a9cd0706 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -220,166 +220,228 @@ class DoctorHeader extends StatelessWidget { child: Dialog( child: Column( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - // height: 400.0, width: MediaQuery.of(context).size.width * 0.8, color: Colors.white, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - alignment: Alignment.center, width: MediaQuery.of(context).size.width, - color: Theme.of(context).primaryColor, - margin: EdgeInsets.only(bottom: 5.0), - padding: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), - Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: RatingBar.readOnly( - initialRating: this.headerModel.actualDoctorRate.toDouble(), - size: 35.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), + padding: EdgeInsets.all(20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black, fontWeight: FontWeight.w600, letterSpacing: -0.64)), + IconButton( + icon: Icon( + Icons.close, + color: Colors.black, + ), + onPressed: () { + Navigator.pop(context); + }, + ), + ], + )), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container(margin: EdgeInsets.only(left: 20.0), child: Text(this.headerModel.decimalDoctorRate != null ? this.headerModel.decimalDoctorRate : this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black, fontWeight: FontWeight.bold))), + Container( + margin: EdgeInsets.symmetric(horizontal: 20.0), + child: RatingBar.readOnly( + initialRating: this.headerModel.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], ), Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))), + margin: EdgeInsets.symmetric(horizontal: 20.0), + child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))), Container( margin: EdgeInsets.only(top: 10.0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 100.0, - margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[0].patientNumber), - height: 6.0, - child: Container( - color: Colors.green[700], + Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), ), - ), + ], + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), ), Container( child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 100.0, - margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[1].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffB7B723), + Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), ), - ), + ], + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), ), Container( child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 100.0, - margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[2].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEBA727), + Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), ), - ), + ], + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), ), Container( child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 100.0, - margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[3].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEB7227), + Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), ), - ), + ], + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), ), Container( + margin: EdgeInsets.only(bottom: 30.0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 100.0, - margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[4].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffE20C0C), + Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), ), - ), + ], ), - ], - ), - ), - Container(margin: EdgeInsets.only(top: 40.0), child: Divider()), - Container( - margin: EdgeInsets.only(top: 0.0), - child: Align( - alignment: FractionalOffset.bottomCenter, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 40.0, - child: RaisedButton( - elevation: 0.0, - color: Colors.white, - textColor: Colors.red, - hoverColor: Colors.transparent, - focusColor: Colors.transparent, - highlightColor: Colors.transparent, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), - ), + ], ), ), + // Container(margin: EdgeInsets.only(top: 40.0), child: Divider()), + // Container( + // margin: EdgeInsets.only(top: 0.0), + // child: Align( + // alignment: FractionalOffset.bottomCenter, + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width, + // height: 40.0, + // child: RaisedButton( + // elevation: 0.0, + // color: Colors.white, + // textColor: Colors.red, + // hoverColor: Colors.transparent, + // focusColor: Colors.transparent, + // highlightColor: Colors.transparent, + // disabledColor: new Color(0xFFbcc2c4), + // onPressed: () { + // Navigator.of(context).pop(); + // }, + // child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ), + // ), ], ), ), @@ -398,6 +460,6 @@ class DoctorHeader extends StatelessWidget { double getRatingWidth(int patientNumber) { var width = (patientNumber / this.headerModel.totalReviews) * 100; - return width; + return width.roundToDouble(); } } From 54c3beadf25d255e2cd8a7a8e8e5baa1db0513a0 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 13 Oct 2021 15:52:30 +0300 Subject: [PATCH 11/33] improvements. --- lib/config/localized_values.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f63eeeb4..139ee7a6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -911,14 +911,14 @@ const Map localizedValues = { "info-todo": { "en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done", "ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" - + }, "family-info": { "en": "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." }, "update-succ": {"en": "Successfully updated profile", "ar": "تم تحديث البيانات بنجاح"}, "dental-complains": {"en": "Symptoms", "ar": "الأعراض"}, - "empt},y-result": {"en": "There is no search results found", "ar": "لايوجد نتائج"}, + "empty-result": {"en": "There is no search results found", "ar": "لايوجد نتائج"}, "no-booked-appointment": {"en": "No booked appointments", "ar": "لا يوجد مواعيد محجوزة"}, "no-confirmed-appointment": {"en": "No confirmed appointments", "ar": "لا توجد مواعيد مؤكدة"}, "no-arrived-appointment": {"en": "No arrived appointments", "ar": "لا يوجد مواعيد"}, From e3a7c08e7c922b295b8b2e7c7dfe9b9b5cb79790 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 13 Oct 2021 15:55:18 +0300 Subject: [PATCH 12/33] blood type changes --- lib/core/viewModels/dashboard_view_model.dart | 1 + lib/pages/DrawerPages/family/my-family.dart | 4 ++-- lib/pages/login/confirm-login.dart | 3 +-- lib/pages/login/login.dart | 2 +- lib/services/authentication/auth_provider.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index c2211993..fca76cbf 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -21,6 +21,7 @@ class DashboardViewModel extends BaseViewModel { if (isLogin && _vitalSignService.weightKg.isEmpty) { setState(ViewState.Busy); await _vitalSignService.getPatientRadOrders(); + if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 12f7d46d..c3e136a0 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -531,14 +531,14 @@ class _MyFamily extends State with TickerProviderStateMixin { result = list.CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); - + var bloodType = await sharedPref.getString(BLOOD_TYPE); var mainUser = await sharedPref.getObject(MAIN_USER); var loginType = await sharedPref.getInt(LAST_LOGIN); this.sharedPref.clear(); if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; } - + this.sharedPref.setString(BLOOD_TYPE, bloodType); this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setInt(LAST_LOGIN, loginType); this.sharedPref.setObject(MAIN_USER, mainUser); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index ae2a4e33..58453550 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -536,8 +536,7 @@ class _ConfirmLogin extends State { sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, userData = result.list, - // sharedPref.setString( - // BLOOD_TYPE, result['PatientBloodType']), + sharedPref.setString(BLOOD_TYPE, result.patientBloodType), authenticatedUserObject.user = result.list, projectViewModel.setPrivilege(privilegeList: res), sharedPref.setObject(MAIN_USER, result.list), diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index b448e1a4..9c245e01 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -308,7 +308,7 @@ class _Login extends State { projectViewModel.setPrivilege(privilegeList: result); result = CheckActivationCode.fromJson(result); result.list.isFamily = false; - // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), + this.sharedPref.setString(BLOOD_TYPE, result.patientBloodType); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(MAIN_USER, result.list); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index fb32af8f..af1fd3f6 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -236,7 +236,7 @@ class AuthProvider with ChangeNotifier { return Future.value(error); // throw error; }, body: neRequest.toJson()); - sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); + // sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); return Future.value(localRes); } catch (error) { throw localRes; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index c790aeef..7817ce38 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -543,7 +543,7 @@ class _AppDrawerState extends State { Utils.hideProgressDialog(); Provider.of(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: !isMainUser); result = CheckActivationCode.fromJson(result); - + var bloodType = await sharedPref.getString(BLOOD_TYPE); var familyFile = await sharedPref.getObject(FAMILY_FILE); var currentLang = await sharedPref.getString(APP_LANGUAGE); var mainUser = await sharedPref.getObject(MAIN_USER); @@ -556,6 +556,7 @@ class _AppDrawerState extends State { } // result.list.cRSVerificationStatus = result['CRSVerificationStatus']; this.sharedPref.setString(APP_LANGUAGE, currentLang); + this.sharedPref.setString(BLOOD_TYPE, bloodType); this.sharedPref.setInt(LAST_LOGIN, loginType); this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(USER_PROFILE, result.list); From 8ea6a5de04498dcf7950397c46e347af6eca006e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 13 Oct 2021 16:27:57 +0300 Subject: [PATCH 13/33] localization fix --- lib/config/localized_values.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 10a3662d..a8f99f68 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -610,7 +610,7 @@ const Map localizedValues = { "years-old": {"en": "years old", "ar": "سنة"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "refine": {"en": "Refine", "ar": "تصفية"}, - "reset": {"en": "Reset", "ar": "اعادة ضبط"}, + "reset": {"en": "Reset", "ar": "اعادة تعيين"}, "apply": {"en": "Apply", "ar": "تطبيق"}, "viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"}, "categorise": {"en": "Categories", "ar": "التطبيقات"}, @@ -1497,7 +1497,7 @@ const Map localizedValues = { "years": {"en": "Years", "ar": "سنوات"}, "respirationBPM": {"en": "bpm", "ar": "نفس"}, "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, - "invoiceDetails": { "en": "Invoice Details", "ar": "تفاصيل الفاتورة" }, + "invoiceDetails": {"en": "Invoice Details", "ar": "تفاصيل الفاتورة"}, "appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"}, "appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"}, }; From 40cbca565a72bd4c958c30ef5d152ed34ac9f28e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 13 Oct 2021 18:06:52 +0300 Subject: [PATCH 14/33] fixes --- .../e_referral_service.dart | 2 - .../AppoimentAllHistoryResultList.dart | 2 +- lib/pages/DrawerPages/family/my-family.dart | 52 ++++++++++++------- lib/pages/MyAppointments/MyAppointments.dart | 1 - lib/widgets/buttons/defaultButton.dart | 5 +- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/lib/core/service/AlHabibMedicalService/e_referral_service.dart b/lib/core/service/AlHabibMedicalService/e_referral_service.dart index b1d716a9..7fcc5f19 100644 --- a/lib/core/service/AlHabibMedicalService/e_referral_service.dart +++ b/lib/core/service/AlHabibMedicalService/e_referral_service.dart @@ -117,8 +117,6 @@ class EReferralService extends BaseService { _allReferral.clear(); hasError = false; - searchEReferralRequestModel.patientMobileNumber = "966545156035"; - // TODO return this code when the fix the server await baseAppClient.post(GET_E_REFERRALS, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index f14e23d0..a79767c5 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -39,7 +39,7 @@ class AppoitmentAllHistoryResultList { String doctorImageURL; String doctorNameObj; int doctorRate; - double decimalDoctorRate; + dynamic decimalDoctorRate; List doctorSpeciality; String doctorTitle; int gender; diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index c3e136a0..8d0042e2 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; @@ -34,7 +35,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; @@ -192,24 +192,40 @@ class _MyFamily extends State with TickerProviderStateMixin { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - CupertinoSwitch( - value: isSwitchUser, - onChanged: (value) { - setState(() { - isSwitchUser = value; - }); - if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); - }, - ), - Texts( - TranslationBase.of(context).switchUser, - color: Colors.white, - fontSize: 12, - ) - ], + Container( + margin: EdgeInsets.only(top: 5.0), + width: 100.0, + child: DefaultButton( + TranslationBase.of(context).switchUser, + () { + // setState(() { + // isSwitchUser = value; + // }); + switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], AppGlobal.context); + }, + fontSize: 12.0, + color: Colors.white, + textColor: Colors.black, + ), ), + // Row( + // children: [ + // CupertinoSwitch( + // value: isSwitchUser, + // onChanged: (value) { + // setState(() { + // isSwitchUser = value; + // }); + // if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); + // }, + // ), + // Texts( + // TranslationBase.of(context).switchUser, + // color: Colors.white, + // fontSize: 12, + // ) + // ], + // ), InkWell( onTap: () { deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 38fbdce9..b65c5235 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -167,7 +167,6 @@ class _MyAppointmentsState extends State with SingleTickerProvid GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - Navigator.of(context).pop(); }); } diff --git a/lib/widgets/buttons/defaultButton.dart b/lib/widgets/buttons/defaultButton.dart index c1d6fb3d..22430242 100644 --- a/lib/widgets/buttons/defaultButton.dart +++ b/lib/widgets/buttons/defaultButton.dart @@ -7,7 +7,8 @@ class DefaultButton extends StatelessWidget { final Color color; final Color disabledColor; final IconData iconData; - DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white, this.iconData}); + final double fontSize; + DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white, this.iconData, this.fontSize}); @override Widget build(BuildContext context) { @@ -23,7 +24,7 @@ class DefaultButton extends StatelessWidget { child: Text( text, textAlign: TextAlign.center, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), ), ), ], From a39658206def6f6fda668035fe20a19a3b9e6f10 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 14 Oct 2021 14:18:30 +0300 Subject: [PATCH 15/33] my family --- lib/config/config.dart | 5 ++--- lib/pages/DrawerPages/family/my-family.dart | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 126cb034..18abad39 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -438,7 +438,6 @@ const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; - // CMC RC SERVICES const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc'; const ADD_CMC_ORDER_RC = 'rc/api/cmc/add'; diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index c3e136a0..ad4494e6 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -546,7 +546,8 @@ class _MyFamily extends State with TickerProviderStateMixin { this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); - + _vitalSignService.heightCm = ""; + _vitalSignService.weightKg = ""; await authenticatedUserObject.getUser(getUser: true); Provider.of(AppGlobal.context, listen: false).user = authenticatedUserObject.user; Provider.of(AppGlobal.context, listen: false).setUser(authenticatedUserObject.user); From 07a98d75c6270ebfaf5d9f36928b43ccf4b57ea3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Oct 2021 14:45:08 +0300 Subject: [PATCH 16/33] My tracker fixes --- .../service/medical/BloodPressureService.dart | 3 + .../medical/WeightPressureService.dart | 12 +- .../medical/blood_pressure_view_model.dart | 6 +- .../Appointments/DoctorRateDetails.dart | 6 +- .../orders_log_details_page.dart | 4 +- .../AlHabibMedicalService/parking_page.dart | 3 +- lib/pages/feedback/status_feedback_page.dart | 4 +- lib/pages/livecare/livecare_home.dart | 24 ++- lib/pages/livecare/widgets/livecare_logs.dart | 30 +-- lib/pages/medical/allergies_page.dart | 2 + .../my_trackers/Weight/AddWeightPage.dart | 89 ++++---- .../my_trackers/Weight/WeightWeeklyPage.dart | 8 +- .../blood_pressure/AddBloodPressurePage.dart | 79 ++++--- .../blood_pressure/BloodPressureHomePage.dart | 197 ++++++++++-------- .../bloodPressureWeeklyPage.dart | 2 + .../blood_suger/AddBloodSugarPage.dart | 95 ++++----- .../blood_suger/blood_sugar_home_page.dart | 61 +++--- .../blood_suger/blood_sugar_weekly_page.dart | 8 +- .../widget/MonthCurvedChartBloodPressure.dart | 3 +- .../medical/reports/report_list_widget.dart | 5 +- lib/widgets/charts/show_chart.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 2 + lib/widgets/new_design/doctor_header.dart | 142 +++++-------- 23 files changed, 396 insertions(+), 391 deletions(-) diff --git a/lib/core/service/medical/BloodPressureService.dart b/lib/core/service/medical/BloodPressureService.dart index 7a849808..08ca9027 100644 --- a/lib/core/service/medical/BloodPressureService.dart +++ b/lib/core/service/medical/BloodPressureService.dart @@ -24,6 +24,7 @@ class BloodPressureService extends BaseService { monthDiabtectResultAverageList.clear(); weekDiabtectResultAverageList.clear(); yearDiabtecResultAverageList.clear(); + response['List_MonthBloodPressureResultAverage'].forEach((item) { monthDiabtectResultAverageList .add(MonthBloodPressureResultAverage.fromJson(item)); @@ -111,6 +112,7 @@ class BloodPressureService extends BaseService { {String bloodPressureDate, String diastolicPressure, String systolicePressure, + int lineItemNo, int measuredArm}) async { hasError = false; super.error = ""; @@ -120,6 +122,7 @@ class BloodPressureService extends BaseService { body['DiastolicPressure'] = diastolicPressure; body['SystolicePressure'] = systolicePressure; body['MeasuredArm'] ='$measuredArm'; + body['LineItemNo'] = lineItemNo; body['isDentalAllowedBackend'] = false; await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT, diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart index 6d150c28..5cfcc35c 100644 --- a/lib/core/service/medical/WeightPressureService.dart +++ b/lib/core/service/medical/WeightPressureService.dart @@ -20,10 +20,10 @@ class WeightService extends BaseService { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; + monthWeightMeasurementResultAverage.clear(); + weekWeightMeasurementResultAverage.clear(); + yearWeightMeasurementResultAverage.clear(); await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) { - monthWeightMeasurementResultAverage.clear(); - weekWeightMeasurementResultAverage.clear(); - yearWeightMeasurementResultAverage.clear(); response['List_MonthWeightMeasurementResultAverage'].forEach((item) { monthWeightMeasurementResultAverage.add(MonthWeightMeasurementResultAverage.fromJson(item)); }); @@ -43,10 +43,10 @@ class WeightService extends BaseService { Future getWeightMeasurementResult() async { hasError = false; + monthWeightMeasurementResult.clear(); + weekWeightMeasurementResult.clear(); + yearWeightMeasurementResult.clear(); await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, onSuccess: (dynamic response, int statusCode) { - monthWeightMeasurementResult.clear(); - weekWeightMeasurementResult.clear(); - yearWeightMeasurementResult.clear(); response['List_WeekWeightMeasurementResult'].forEach((item) { weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart index 596a9c1e..3d772095 100644 --- a/lib/core/viewModels/medical/blood_pressure_view_model.dart +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -75,17 +75,17 @@ class BloodPressureViewMode extends BaseViewModel { } } - Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, bool isUpdate = false}) async { + Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, int lineItemNo, bool isUpdate = false}) async { setState(ViewState.BusyLocal); if (!isUpdate) await bloodPressureService.addDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm); else - await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm); + await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm, lineItemNo: lineItemNo); if (bloodPressureService.hasError) { error = bloodPressureService.error; setState(ViewState.ErrorLocal); } else { - await getBloodPressure(); + // await getBloodPressure(); setState(ViewState.Idle); } } diff --git a/lib/models/Appointments/DoctorRateDetails.dart b/lib/models/Appointments/DoctorRateDetails.dart index b29a5db9..58668856 100644 --- a/lib/models/Appointments/DoctorRateDetails.dart +++ b/lib/models/Appointments/DoctorRateDetails.dart @@ -4,13 +4,15 @@ class DoctorRateDetails { dynamic clinicID; dynamic rate; dynamic patientNumber; + dynamic ratio; DoctorRateDetails( {this.doctorID, this.projectID, this.clinicID, this.rate, - this.patientNumber}); + this.patientNumber, + this.ratio}); DoctorRateDetails.fromJson(Map json) { doctorID = json['DoctorID']; @@ -18,6 +20,7 @@ class DoctorRateDetails { clinicID = json['ClinicID']; rate = json['Rate']; patientNumber = json['PatientNumber']; + ratio = json['Ratio']; } Map toJson() { @@ -27,6 +30,7 @@ class DoctorRateDetails { data['ClinicID'] = this.clinicID; data['Rate'] = this.rate; data['PatientNumber'] = this.patientNumber; + data['Ratio'] = this.ratio; return data; } } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index b64c5d7d..12879ac9 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -49,7 +49,7 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - body: ListView.separated( + body: model.hhcAllPresOrders.length > 0 ? ListView.separated( padding: EdgeInsets.all(21), physics: BouncingScrollPhysics(), itemBuilder: (context, index) { @@ -170,7 +170,7 @@ class OrdersLogDetailsPage extends StatelessWidget { ); }, separatorBuilder: (context, index) => SizedBox(height: 12), - itemCount: model.hhcAllPresOrders.length), + itemCount: model.hhcAllPresOrders.length) : getNoDataWidget(context), ); } } diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart index 864beb98..ac63011c 100644 --- a/lib/pages/AlHabibMedicalService/parking_page.dart +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -32,7 +32,7 @@ class ParkingPage extends StatelessWidget { ? Column( children: [ Texts( - TranslationBase.of(context).parkingTitle, + TranslationBase.of(context).parkingDescription, fontWeight: FontWeight.normal, fontSize: 15, ), @@ -149,6 +149,7 @@ class ParkingPage extends StatelessWidget { ), bottomSheet: !model.isSavePark ? Container( + color: Theme.of(context).scaffoldBackgroundColor, height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, child: Column( diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 6ac4d557..3ab445b2 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -125,7 +125,7 @@ class _StatusFeedbackPageState extends State { ), ], ), - bottomSheet: Container( + bottomSheet: projectViewModel.isLogin ? Container( color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( @@ -133,7 +133,7 @@ class _StatusFeedbackPageState extends State { projectViewModel.isLogin ? null : () => {}, disabledColor: Colors.grey, ), - ), + ) : Container(), ), ); } diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 06070a7f..f91121e3 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -64,8 +64,28 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt TabBar( labelColor: Colors.black, tabs: [ - Tab(text: TranslationBase.of(context).consultation), - Tab(text: TranslationBase.of(context).logs), + Tab( + child: Text( + TranslationBase.of(context).consultation, + style: TextStyle( + color: Colors.black, + fontSize: 14, + letterSpacing: -0.36, + fontWeight: FontWeight.w600, + ), + ), + ), + Tab( + child: Text( + TranslationBase.of(context).logs, + style: TextStyle( + color: Colors.black, + fontSize: 14, + letterSpacing: -0.36, + fontWeight: FontWeight.w600, + ), + ), + ), ], controller: _tabController, ), diff --git a/lib/pages/livecare/widgets/livecare_logs.dart b/lib/pages/livecare/widgets/livecare_logs.dart index a7f7fdc0..7b85afc2 100644 --- a/lib/pages/livecare/widgets/livecare_logs.dart +++ b/lib/pages/livecare/widgets/livecare_logs.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareHistoryCard.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; class LiveCareLogs extends StatefulWidget { @@ -20,21 +21,20 @@ class _LiveCareLogsState extends State { @override Widget build(BuildContext context) { return SingleChildScrollView( - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: widget.erRequestHistoryList.length, - itemBuilder: (context, index) { - return widget.erRequestHistoryList[index].callStatus < 4 - ? Container() - : LiveCareHistoryCard( - erRequestHistoryList: widget.erRequestHistoryList[index]); - }, - ), - ), + child: widget.erRequestHistoryList.length > 0 + ? Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.erRequestHistoryList.length, + itemBuilder: (context, index) { + return widget.erRequestHistoryList[index].callStatus < 4 ? Container() : LiveCareHistoryCard(erRequestHistoryList: widget.erRequestHistoryList[index]); + }, + ), + ) + : Container(margin: EdgeInsets.only(top: 200.0), child: getNoDataWidget(context)), ); } } diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index 459ef0f8..e83cf1d5 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -16,6 +16,8 @@ class AllergiesPage extends StatelessWidget { onModelReady: (model) => model.getAllergies(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).allergies, baseViewModel: model, description: TranslationBase.of(context).infoAllergies, diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart index f01bb05f..5380896e 100644 --- a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.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/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -51,9 +51,10 @@ class _AddWeightPageState extends State { dayWeightDate = widget.dayWeightDate; timeWeightDate = widget.dayWeightDate; measureTimeSelectedType = widget.measureTimeSelectedType; - if (measureUnitEnList.contains(widget.measureTimeSelectedType)) - weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType); - else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType); + weightUnit = widget.weightUnit; + // if (measureUnitEnList.contains(widget.measureTimeSelectedType)) + // weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType); + // else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType); _weightValueController.text = widget.weightValue; validateForm(); } @@ -215,46 +216,46 @@ class _AddWeightPageState extends State { ), ), bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), - child: Button( - onTap: () async { - if (_weightValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - if (widget.isUpdate) { - widget.model - .updateWeightResult( - weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', - weightMeasured: _weightValueController.text.toString(), - weightUnit: weightUnit, - lineItemNo: widget.lineItemNo) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.Error) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - }); - } else - widget.model - .addWeightResult( - weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', - weightMeasured: _weightValueController.text.toString(), - weightUnit: weightUnit, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.Error) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - }); - } - }, - label: TranslationBase.of(context).save.toUpperCase(), - backgroundColor: isButtonDisabled ? Colors.grey : Colors.red[900], - disabled: isButtonDisabled, + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(20.0), + child: DefaultButton( + TranslationBase.of(context).save.toUpperCase(), + isButtonDisabled ? null : () async { + if (_weightValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + if (widget.isUpdate) { + widget.model + .updateWeightResult( + weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit + 1, + lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } else + widget.model + .addWeightResult( + weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } + }, + disabledColor: Colors.grey, + ), ), )); } diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 448d8809..54891563 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -56,7 +55,8 @@ class WeightWeeklyPage extends StatelessWidget { shape: cardRadius(12), elevation: 1, margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8.0), @@ -124,7 +124,7 @@ class WeightWeeklyPage extends StatelessWidget { page: AddWeightPage( isUpdate: true, dayWeightDate: diabtec.weightDate, - measureTimeSelectedType: 'Kg', + measureTimeSelectedType: diabtec.unit == "1" ? 'Kg' : 'Pound', weightValue: diabtec.weightMeasured.toString(), lineItemNo: diabtec.lineItemNo, weightUnit: int.parse(diabtec.unit), @@ -138,8 +138,6 @@ class WeightWeeklyPage extends StatelessWidget { }); }, child: Container( - // height: 70, - // padding: EdgeInsets.all(10), child: Icon( Icons.edit, color: Color(0xff575757), diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 4e64bb6f..44a28209 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -7,6 +7,7 @@ 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/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -21,11 +22,13 @@ class AddBloodPressurePage extends StatefulWidget { final String measureTimeSelectedType; final bool isUpdate; final int lineItemNo; + final int measuredArm; final String bloodSystolicValue; final String bloodDiastolicValue; final BloodPressureViewMode model; - const AddBloodPressurePage({Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.model, this.bloodSystolicValue, this.bloodDiastolicValue}) + const AddBloodPressurePage( + {Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.measuredArm, this.model, this.bloodSystolicValue, this.bloodDiastolicValue}) : super(key: key); @override @@ -39,13 +42,10 @@ class _AddBloodPressurePageState extends State { DateTime timeSugarDate = DateTime.now(); int measuredArm = 1; bool isButtonDisabled = true; - final List measureTimeEnList = [ - 'Left Arm ', - 'Right Arm', - ]; + final List measureTimeEnList = ['Right Arm', 'Left Arm']; final List measureTimeArList = [ - 'الذراع الأيسر', 'الذراع الأيمن', + 'الذراع الأيسر', ]; String measureTimeSelectedType = 'Left Arm'; @@ -56,9 +56,7 @@ class _AddBloodPressurePageState extends State { bloodSugarDate = widget.bloodSugarDate; bloodSugarDate = widget.bloodSugarDate; measureTimeSelectedType = widget.measureTimeSelectedType; - if (measureTimeEnList.contains(widget.measureTimeSelectedType)) - measuredArm = measureTimeEnList.indexOf(widget.measureTimeSelectedType); - else if (measureTimeArList.contains(widget.measureTimeSelectedType)) measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType); + measuredArm = widget.measuredArm - 1; _bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue; validateForm(); @@ -119,7 +117,7 @@ class _AddBloodPressurePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(projectViewModel.isArabic ? measureTimeArList[0] : measureTimeEnList[0]), + Texts(projectViewModel.isArabic ? measureTimeArList[measuredArm] : measureTimeEnList[measuredArm]), Icon( Icons.arrow_drop_down, color: Colors.grey, @@ -224,38 +222,37 @@ class _AddBloodPressurePageState extends State { ), ), bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), - child: Button( - onTap: () async { - if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - - widget.model - .addORUpdateDiabtecResult( - isUpdate: widget.isUpdate, - bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: measuredArm, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.BusyLocal) + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(20.0), + child: DefaultButton( + TranslationBase.of(context).save, + isButtonDisabled ? null : () async { + if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + widget.model + .addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: (measuredArm + 1), + lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + ; + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - ; - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: widget.model.error); - }); - } - }, - label: TranslationBase.of(context).save.toUpperCase(), - backgroundColor: isButtonDisabled ? Colors.grey : Colors.red[900], - disabled: isButtonDisabled, + }); + } + }, + disabledColor: Colors.grey, + ), ), )); } diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index 7dd4d619..a99b75ea 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -1,22 +1,23 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.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/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + import 'AddBloodPressurePage.dart'; import 'BloodPressureMonthly.dart'; import 'BloodPressureYeaPage.dart'; import 'bloodPressureWeeklyPage.dart'; -import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; class BloodPressureHomePage extends StatefulWidget { @override @@ -43,97 +44,113 @@ class _BloodPressureHomePageState extends State with Sing ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getBloodPressure(), - builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).bloodPressure, - showNewAppBar: true, - showNewAppBarTitle: true, - baseViewModel: model, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: TabBarWidget( - tabController: _tabController, - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - BloodPressureWeeklyPage( - model: model, - ), - BloodPressureMonthlyPage( - model: model, - ), - BloodPressureYearPage( - model: model, - ) - ], - ), - ) - ], - ), - floatingActionButton: Stack(children: [ - Positioned( - bottom: 80, - right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddBloodPressurePage( + builder: (_, model, w) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase + .of(context) + .bloodPressure, + showNewAppBar: true, + showNewAppBarTitle: true, + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: TabBarWidget( + tabController: _tabController, + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodPressureWeeklyPage( + model: model, + ), + BloodPressureMonthlyPage( model: model, - ))); - }, - child: Container( - width: 50, - height: 50, - decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, ), - )), - )) - ]), - bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), - child: Button( - onTap: () { - showDialog( - context: context, - child: ConfirmSendEmailDialog( - email: model.user.emailAddress, - onTapSendEmail: () async { - GifLoaderDialogUtils.showMyDialog(context); - model.sendReportByEmail().then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - AppToast.showErrorToast(message: model.error); - } else { - AppToast.showSuccessToast( - message: TranslationBase.of(context).emailSentSuccessfully, - ); - } - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: model.error); - }); + BloodPressureYearPage( + model: model, + ) + ], + ), + ) + ], + ), + floatingActionButton: Stack(children: [ + Positioned( + bottom: 60, + right: projectViewModel.isArabic ? MediaQuery + .of(context) + .size + .width * .85 : 0, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddBloodPressurePage( + model: model, + ))).then((value) { + model.getBloodPressure(); + }); + }, + child: Container( + width: 50, + height: 50, + decoration: BoxDecoration(shape: BoxShape.circle, color: Theme + .of(context) + .primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + )), + )) + ]), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase + .of(context) + .sendEmail, + () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async { + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase + .of(context) + .emailSentSuccessfully, + ); + } + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: model.error); + }); + }, + ), + ); }, + // label: TranslationBase.of(context).sendEmail, + // backgroundColor: Colors.red[900], ), - ); - }, - label: TranslationBase.of(context).sendEmail, - backgroundColor: Colors.red[900], - ), - ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index b4974159..1e7f3b8b 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -109,9 +109,11 @@ class BloodPressureWeeklyPage extends StatelessWidget { bloodDiastolicValue: diabtec.diastolicPressure.toString(), bloodSystolicValue: diabtec.systolicePressure.toString(), measureTimeSelectedType: diabtec.measuredArmDesc, + measuredArm: diabtec.measuredArm, ), ), ).then((value) { + model.getBloodPressure(); if(model.weekDiabtecPatientResult.isEmpty) { model.weightWeekTimeSeriesDataTop.clear(); model.weightWeekTimeSeriesDataLow.clear(); diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 65005109..0095fb94 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.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/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -23,9 +23,10 @@ class AddBloodSugarPage extends StatefulWidget { final String measuredTime; final String bloodSugarValue; final int lineItemNo; + final String measuredSelectedType; final BloodSugarViewMode bloodSugarViewMode; - AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode}) + AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType}) : super(key: key); @override @@ -77,6 +78,7 @@ class _AddBloodSugarPageState extends State { measuredTime = measureTimeEnList.indexOf(widget.measuredTime); else if (measureTimeArList.contains(widget.measuredTime)) measuredTime = measureTimeArList.indexOf(widget.measuredTime); _bloodSugarValueController.text = widget.bloodSugarValue; + measureTimeSelectedType = widget.measuredSelectedType; validateForm(); } } @@ -89,17 +91,6 @@ class _AddBloodSugarPageState extends State { showNewAppBar: true, showNewAppBarTitle: true, appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - // appBarIcons: widget.isUpdate - // ? [ - // IconButton( - // icon: Icon(Icons.delete), - // color: Colors.white, - // onPressed: () { - - // }, - // ) - // ] - // : null, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( @@ -258,46 +249,48 @@ class _AddBloodSugarPageState extends State { ), ), bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), - child: Button( - onTap: () async { - if (_bloodSugarValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - if (widget.isUpdate) { - await widget.bloodSugarViewMode.updateDiabtecResult( - month: bloodSugarDate, - hour: timeSugarDate, - diabtecUnit: measureUnitSelectedType, - measuredTime: measuredTime, - lineItemNo: widget.lineItemNo, - bloodSugerResult: _bloodSugarValueController.text.toString()); + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(20.0), + child: DefaultButton( + TranslationBase.of(context).save.toUpperCase(), + isButtonDisabled + ? null + : () async { + if (_bloodSugarValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + if (widget.isUpdate) { + await widget.bloodSugarViewMode.updateDiabtecResult( + month: bloodSugarDate, + hour: timeSugarDate, + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + lineItemNo: widget.lineItemNo, + bloodSugerResult: _bloodSugarValueController.text.toString()); - GifLoaderDialogUtils.hideDialog(context); - if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal) - AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); - else - Navigator.pop(context); - } else { - await widget.bloodSugarViewMode.addDiabtecResult( - diabtecUnit: measureUnitSelectedType, - measuredTime: measuredTime, - bloodSugerResult: _bloodSugarValueController.text.toString(), - bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - ); + GifLoaderDialogUtils.hideDialog(context); + if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal) + AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); + } else { + await widget.bloodSugarViewMode.addDiabtecResult( + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + bloodSugerResult: _bloodSugarValueController.text.toString(), + bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + ); - GifLoaderDialogUtils.hideDialog(context); - if (widget.bloodSugarViewMode.state == ViewState.Error) - AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); - else - Navigator.pop(context); - } - } - }, - label: TranslationBase.of(context).save.toUpperCase(), - backgroundColor: isButtonDisabled ? Colors.grey : Colors.red[900], - disabled: isButtonDisabled, + GifLoaderDialogUtils.hideDialog(context); + if (widget.bloodSugarViewMode.state == ViewState.Error) + AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); + } + } + }, + disabledColor: Colors.grey, + ), ), )); } diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 85500a69..13c8392d 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -85,7 +86,7 @@ class _BloodSugarHomePageState extends State with SingleTick floatingActionButton: Stack( children: [ Positioned( - bottom: 130, + bottom: 60, right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0, child: InkWell( onTap: () { @@ -111,36 +112,36 @@ class _BloodSugarHomePageState extends State with SingleTick ], ), bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), - child: Button( - onTap: () { - showDialog( - context: context, - child: ConfirmSendEmailDialog( - email: model.user.emailAddress, - onTapSendEmail: () async { - GifLoaderDialogUtils.showMyDialog(context); - model.sendReportByEmail().then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).sendEmail, + () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async { + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).emailSentSuccessfully, + ); + } + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: model.error); - } else { - AppToast.showSuccessToast( - message: TranslationBase.of(context).emailSentSuccessfully, - ); - } - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: model.error); - }); - }, - ), - ); - }, - label: TranslationBase.of(context).sendEmail, - backgroundColor: Colors.red[900], + }); + }, + ), + ); + }, + ), ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 537265ed..7921d030 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -33,7 +34,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, child: LineChartCurved( - title: '${TranslationBase.of(context).bloodSugar}', + title: '${TranslationBase.of(AppGlobal.context).bloodSugar}', timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, indexes: timeSeriesData.length ~/ 5.5, ), @@ -43,7 +44,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), + child: Texts(TranslationBase.of(AppGlobal.context).details), ), Container( padding: EdgeInsets.all(10), @@ -54,7 +55,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { timeSeriesData.isEmpty ? Container( child: Center( - child: Texts(TranslationBase.of(context).noDataAvailable), + child: Texts(TranslationBase.of(AppGlobal.context).noDataAvailable), ), ) : Table( @@ -114,6 +115,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { lineItemNo: diabtec.lineItemNo, measureUnitSelectedType: diabtec.unit, bloodSugarViewMode: bloodSugarViewMode, + measuredSelectedType: diabtec.measuredDesc, ), ), ).then((value) { diff --git a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart index ee7e00af..b2721366 100644 --- a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart +++ b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -85,7 +86,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { width: 20, height: 20, decoration: BoxDecoration( - shape: BoxShape.rectangle, color: Colors.grey), + shape: BoxShape.rectangle, color: secondaryColor), ), SizedBox( width: 5, diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 722cddb6..f565594e 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -26,7 +27,7 @@ class ReportListWidget extends StatelessWidget { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - return ListView.separated( + return reportList.length > 0 ? ListView.separated( physics: BouncingScrollPhysics(), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), separatorBuilder: (context, index) => SizedBox(height: 14), @@ -112,7 +113,7 @@ class ReportListWidget extends StatelessWidget { ); }, itemCount: reportList.length, - ); + ) : getNoDataWidget(context) ; } void showConfirmMessage(Reports report) { diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index b5a3c869..b23d90f5 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: 3.0, + interval: null, margin: 12, ), ), diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 7817ce38..53969cd7 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -160,6 +160,7 @@ class _AppDrawerState extends State { ), onTap: () { sharedPref.setBool(IS_ROBOT_INIT, null); + sharedPref.remove(CLINICS_LIST); if (projectProvider.isArabic) { projectProvider.changeLanguage('en'); } else { @@ -310,6 +311,7 @@ class _AppDrawerState extends State { isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, fontHeight: projectProvider.isArabic ? 1 : 0.8, projectProvider: projectProvider), onTap: () { sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); + sharedPref.remove(CLINICS_LIST); sharedPref.setBool(IS_ROBOT_INIT, null); if (projectProvider.isArabic) { projectProvider.changeLanguage('en'); diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index a9cd0706..ed93fe59 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -223,7 +223,7 @@ class DoctorHeader extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width * 0.8, + width: 350.0, color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -249,11 +249,14 @@ class DoctorHeader extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container(margin: EdgeInsets.only(left: 20.0), child: Text(this.headerModel.decimalDoctorRate != null ? this.headerModel.decimalDoctorRate : this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black, fontWeight: FontWeight.bold))), + Container( + margin: EdgeInsets.symmetric(horizontal: 20.0), + child: Text(this.headerModel.decimalDoctorRate != null ? this.headerModel.decimalDoctorRate : this.headerModel.actualDoctorRate.ceilToDouble().toString(), + style: TextStyle(fontSize: 32.0, color: Colors.black, letterSpacing: -0.64, fontWeight: FontWeight.bold))), Container( margin: EdgeInsets.symmetric(horizontal: 20.0), child: RatingBar.readOnly( - initialRating: this.headerModel.actualDoctorRate.toDouble(), + initialRating: this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate) : this.headerModel.actualDoctorRate.toDouble(), size: 35.0, filledColor: Colors.yellow[700], emptyColor: Colors.grey[500], @@ -267,7 +270,9 @@ class DoctorHeader extends StatelessWidget { ), Container( margin: EdgeInsets.symmetric(horizontal: 20.0), - child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))), + transform: Matrix4.translationValues(0.0, -10.0, 0.0), + child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))), Container( margin: EdgeInsets.only(top: 10.0), child: Row( @@ -278,22 +283,14 @@ class DoctorHeader extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[0].patientNumber), - height: 6.0, - child: Container( - color: Colors.green[700], - ), - ), - ), + child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + getRatingLine(doctorDetailsList[0].patientNumber, Colors.green[700]), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -307,22 +304,14 @@ class DoctorHeader extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[1].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffB7B723), - ), - ), - ), + child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + getRatingLine(doctorDetailsList[1].patientNumber, Color(0xffB7B723)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -336,22 +325,14 @@ class DoctorHeader extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[2].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEBA727), - ), - ), - ), + child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + getRatingLine(doctorDetailsList[2].patientNumber, Color(0xffEBA727)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -365,22 +346,14 @@ class DoctorHeader extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[3].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEB7227), - ), - ), - ), + child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + getRatingLine(doctorDetailsList[3].patientNumber, Color(0xffEB7227)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -395,53 +368,18 @@ class DoctorHeader extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[4].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffE20C0C), - ), - ), - ), + child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + getRatingLine(doctorDetailsList[4].patientNumber, Color(0xffE20C0C)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", + style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), ), - // Container(margin: EdgeInsets.only(top: 40.0), child: Divider()), - // Container( - // margin: EdgeInsets.only(top: 0.0), - // child: Align( - // alignment: FractionalOffset.bottomCenter, - // child: ButtonTheme( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10.0), - // ), - // minWidth: MediaQuery.of(context).size.width, - // height: 40.0, - // child: RaisedButton( - // elevation: 0.0, - // color: Colors.white, - // textColor: Colors.red, - // hoverColor: Colors.transparent, - // focusColor: Colors.transparent, - // highlightColor: Colors.transparent, - // disabledColor: new Color(0xFFbcc2c4), - // onPressed: () { - // Navigator.of(context).pop(); - // }, - // child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), - // ), - // ), - // ), - // ), ], ), ), @@ -462,4 +400,26 @@ class DoctorHeader extends StatelessWidget { var width = (patientNumber / this.headerModel.totalReviews) * 100; return width.roundToDouble(); } + + Widget getRatingLine(int patientNumber, Color color) { + return Container( + margin: EdgeInsets.only(top: 10.0), + child: Stack(children: [ + SizedBox( + width: 135.0, + height: 4.0, + child: Container( + color: Colors.grey[300], + ), + ), + SizedBox( + width: getRatingWidth(patientNumber) * 1.35, + height: 4.0, + child: Container( + color: color, + ), + ), + ]), + ); + } } From 803f5a786bfdeb2798b82fc6c87443e960fc7f7e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Oct 2021 15:30:01 +0300 Subject: [PATCH 17/33] Blood pressure chart fix --- .../blood_pressure/bloodPressureWeeklyPage.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 1e7f3b8b..5d39d2e8 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -1,6 +1,7 @@ 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/widgets/charts/app_time_series_chart.dart'; @@ -28,13 +29,19 @@ class BloodPressureWeeklyPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 12.0), padding: EdgeInsets.only(bottom: 12.0), color: Colors.white, - child: CurvedChartBloodPressure( - horizontalInterval: 3.0, + child: LineChartCurvedBloodPressure( title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop, timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, ), + // CurvedChartBloodPressure( + // horizontalInterval: 3.0, + // title: TranslationBase.of(context).bloodPressure, + // timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop, + // timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow, + // indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, + // ), ), SizedBox( height: 12, From f60684ad0873ed31900b249bdf7120403bba6a2c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Oct 2021 16:42:13 +0300 Subject: [PATCH 18/33] Notifications UI redesigned --- .../components/SearchByClinic.dart | 3 +- .../notification_details_page.dart | 11 +- .../notifications/notifications_page.dart | 271 +++++++++++------- lib/pages/ToDoList/widgets/paymentDialog.dart | 74 ++--- lib/pages/landing/landing_page.dart | 9 +- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 6 files changed, 212 insertions(+), 158 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index d1030636..ab36738e 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -224,7 +225,7 @@ class _SearchByClinicState extends State { child: Row( children: [ Checkbox( - activeColor: new Color(0xFF40ACC9), + activeColor: CustomColors.accentColor, value: nearestAppo, onChanged: (bool value) { setState(() { diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index ee1398be..7633ab9c 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -51,12 +51,15 @@ class NotificationsDetailsPage extends StatelessWidget { ), Container( width: double.infinity, - color: Colors.grey[400], child: Padding( padding: const EdgeInsets.all(8.0), - child: Texts( + child: Text( DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), - fontSize: 16, + style: TextStyle( + fontSize: 18.0, + color: Colors.black, + fontWeight: FontWeight.w600 + ), ), ), ), @@ -88,7 +91,7 @@ class NotificationsDetailsPage extends StatelessWidget { children: [ Expanded( child: Center( - child: Texts(notification.message), + child: Text(notification.message), ), ), ], diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index aba2fb13..07356f01 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -4,8 +4,8 @@ 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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -18,9 +18,7 @@ class NotificationsPage extends StatelessWidget { 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 minute = timeOfDay.minute < 10 ? timeOfDay.minute.toString().padLeft(2, '0') : timeOfDay.minute.toString(); String hour = '${timeOfDay.hourOfPeriod}:$minute'; if (timeOfDay.period == DayPeriod.am) { @@ -42,109 +40,182 @@ class NotificationsPage extends StatelessWidget { var prescriptionReport; 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); }, - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).notifications, - baseViewModel: model, - body: ListView( - children: model.notifications - .map( - (notification) => InkWell( - onTap: () async { - if (!notification.isRead) { - model.markAsRead(notification.id); - } - Navigator.push( - context, - FadePage( - page: NotificationsDetailsPage( - notification: notification, - ))); - }, - child: Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 5, left: 10, right: 10, bottom: 5), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + builder: (_, model, widget) => + AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase + .of(context) + .notifications, + baseViewModel: model, + body: ListView.separated( + itemBuilder: (context, index) { + return InkWell( + onTap: () async { + if (!model.notifications[index].isRead) { + model.markAsRead(model.notifications[index].id); + } + Navigator.push( + context, + FadePage( + page: NotificationsDetailsPage( + notification: model.notifications[index], + ))); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: model.notifications[index].isRead ? Theme + .of(context) + .scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + border: Border( + left: BorderSide( + color: model.notifications[index].isRead ? Theme + .of(context) + .scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, + ), + ), ), - border: Border.all( - color: notification.isRead - ? Colors.grey[200] - : CustomColors.accentColor, - width: 0.5), - ), - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: Texts(notification.message)), - if (notification.messageType == "image") - Icon(FontAwesomeIcons.images) - ], - ), - SizedBox( - height: 5, - ), - ], + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + " " + + 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") + Icon( + FontAwesomeIcons.images, + color: CustomColors.grey, + ) + ], + ), + SizedBox( + height: 5, + ), + ], + ), ), ), - ), - SizedBox( - width: 15, - ), - ], - ), - ), - ), - ) - .toList() - ..add( - 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'), + ], + ), ), - ), - )), - ), + ); + }, + separatorBuilder: (context, index) { + return Column( + children: [ + Divider( + color: Colors.grey[300], + thickness: 2.0, + ), + ], + ); + }, + itemCount: model.notifications.length) + ), + // ListView( + // children: model.notifications + // .map( + // (notification) => InkWell( + // onTap: () async { + // if (!notification.isRead) { + // model.markAsRead(notification.id); + // } + // Navigator.push( + // context, + // FadePage( + // page: NotificationsDetailsPage( + // notification: notification, + // ))); + // }, + // child: Container( + // width: double.infinity, + // padding: EdgeInsets.all(8.0), + // decoration: BoxDecoration( + // color: notification.isRead ? CustomColors.white : CustomColors.accentColor.withOpacity(0.05), + // border: Border( + // left: BorderSide( + // color: notification.isRead ? Colors.grey[200] : CustomColors.accentColor, + // width: 5.0, + // ), + // ), + // ), + // child: Row( + // children: [ + // Expanded( + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // Expanded( + // child: Texts(notification.message)), + // if (notification.messageType == "image") + // Icon(FontAwesomeIcons.images, color: CustomColors.grey,) + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Divider( + // height: 5.0, + // color: CustomColors.grey2, + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ) + // .toList() + // ..add( + // 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'), + // ), + // ), + // )), ); } } diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index c46535b3..7c1bf6ed 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -4,7 +4,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; class PaymentDialog extends StatefulWidget { AppoitmentAllHistoryResultList appo; @@ -30,25 +32,18 @@ class _PaymentDialogState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ Container( margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold)), - ), - Divider( - color: Colors.grey, + child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600)), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).appoDetails, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), + child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600)), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.grey[700], fontSize: 15.0, fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), child: Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), child: Text(widget.appo.projectName, style: getTextStyle()), ), Divider( @@ -58,7 +53,7 @@ class _PaymentDialogState extends State { margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), child: Table( children: [ - TableRow(children: [ + TableRow(decoration: BoxDecoration(), children: [ TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), ]), @@ -77,46 +72,38 @@ class _PaymentDialogState extends State { color: Colors.grey, ), Container( - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), + child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600)), ), Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 15.0), - child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor)), - ), - Divider( - color: Colors.grey, + margin: EdgeInsets.fromLTRB(20.0, 30.0, 20.0, 15.0), + child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600)), ), Container( alignment: Alignment.center, height: 40.0, + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), child: Flex( direction: Axis.horizontal, children: [ Expanded( - child: InkWell( - onTap: () { + child: DefaultButton( + TranslationBase.of(context).cancel, + () { Navigator.pop(context, null); }, - child: Container( - child: Text(TranslationBase.of(context).cancel, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, color: CustomColors.accentColor)), - ), + color: Color(0xffEAEAEA), + textColor: Colors.black, ), ), + mWidth(10.0), Expanded( - child: InkWell( - onTap: () { + child: DefaultButton( + TranslationBase.of(context).confirm, + () { Navigator.pop(context, widget.patientShareResponse); -// widget.onPaymentMethodSelected(); }, - child: Container( - child: Text(TranslationBase.of(context).ok, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - )), - ), ), ), ], @@ -131,28 +118,17 @@ class _PaymentDialogState extends State { _getNormalText(text) { return Container( margin: EdgeInsets.only(top: 10.0, right: 10.0), - child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), + child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.black)), ); } TextStyle getTextStyle() { - return TextStyle(color: Colors.grey[700], fontSize: 13.0); + return TextStyle(color: Colors.grey[700], fontSize: 13.0, fontWeight: FontWeight.w600); } -// Future navigateToPaymentMethod(context) async { -// Navigator.push( -// context, MaterialPageRoute(builder: (context) => PaymentMethod())); -// } - String getDate(String date) { DateTime dateObj = DateUtil.convertStringToDate(date); - return DateUtil.getWeekDay(dateObj.weekday) + - ", " + - dateObj.day.toString() + - " " + - DateUtil.getMonth(dateObj.month) + - " " + - dateObj.year.toString() + + return DateUtil.getDayMonthYearDateFormatted(dateObj) + " " + dateObj.hour.toString() + ":" + diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 13cc2dce..cebcacdc 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -173,19 +173,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { // pageController.jumpToPage(tab); } else { - if (currentTab > 0 && tab == 2) + if (currentTab > 0 && tab == 2) { pageController.jumpToPage(0); - else if (tab != 0) { + currentTab = tab; + } else if (tab != 0) { if (tab == 4 && projectViewModel.isLogin && model.count == 0) { AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); } else { pageController.jumpToPage(tab); + currentTab = tab; } } else { pageController.jumpToPage(tab); + currentTab = tab; } - currentTab = tab; + // currentTab = tab; } }); } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 53969cd7..ce0a86d3 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -360,7 +360,7 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - if (!projectProvider.user.isFamily) Navigator.push(context, FadePage(page: NotificationsPage())); + if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3)) From a026fbf940bd54f107cd87783d4ab1ad9684db31 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 14 Oct 2021 16:47:32 +0300 Subject: [PATCH 19/33] feedback status added. --- lib/config/localized_values.dart | 8 + .../service/feedback/feedback_service.dart | 56 +-- .../feedback/feedback_view_model.dart | 40 +- lib/pages/feedback/status_feedback_page.dart | 377 +++++++++++++----- lib/uitl/translations_delegate_base.dart | 11 +- lib/uitl/utils.dart | 2 + .../dialogs/radio_selection_dialog.dart | 121 ++++++ 7 files changed, 474 insertions(+), 141 deletions(-) create mode 100644 lib/widgets/dialogs/radio_selection_dialog.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 10a3662d..c4dd23c5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -606,6 +606,8 @@ const Map localizedValues = { "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, + + "select": {"en": "Select", "ar": "يختار"}, "i-am": {"en": "I am", "ar": "أنا"}, "years-old": {"en": "years old", "ar": "سنة"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, @@ -1299,6 +1301,8 @@ const Map localizedValues = { "app-update": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"}, "covid-alert": {"en": "Alert", "ar": "تنبيه"}, "enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم التعريف"}, + "identificationNumber": {"en": "Identification Number", "ar": "رقم الهوية"}, + "complaintNumber": {"en": "Complaint Number", "ar": "رقم الشكوى"}, "accountActivationDesc": { "en": " This service allows you to activate your LAKUM account after registering completed.", "ar": " تتيح لك هذه الخدمة تفعيل حساب برنامج الولاء لكم بعد اكتمال التسجيل. " @@ -1500,4 +1504,8 @@ const Map localizedValues = { "invoiceDetails": { "en": "Invoice Details", "ar": "تفاصيل الفاتورة" }, "appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"}, "appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"}, + "selectSearchCriteria": {"en": "Select the search criteria", "ar": "حدد معايير البحث"}, + "enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"}, + "enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"}, + 'please_select_from_below_options': {'en': 'Please select from below options:', 'ar': 'الرجاء التحديد من الخيارات أدناه:'}, }; diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 57bb9c51..9e2245e6 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -13,37 +13,28 @@ class FeedbackService extends BaseService { RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem(); List appointHistoryList = List(); - Future sendCOCItem( - {String title, - String details, - String cOCTypeName, - String attachment, - AppoitmentAllHistoryResultList appointHistory}) async { + Future sendCOCItem({String title, String details, String cOCTypeName, String attachment, AppoitmentAllHistoryResultList appointHistory}) async { hasError = false; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _requestInsertCOCItem.attachment = attachment; _requestInsertCOCItem.title = title; _requestInsertCOCItem.details = details; _requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName; - _requestInsertCOCItem.mobileNo = - "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); + _requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); _requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.appVersion = VERSION_ID; - _requestInsertCOCItem.uILanguage = - languageID; //TODO Change it to be dynamic + _requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic _requestInsertCOCItem.browserInfo = Platform.localHostname; _requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.projectID = 0; _requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; - _requestInsertCOCItem.identificationNo = - int.parse(user.patientIdentificationNo); + _requestInsertCOCItem.identificationNo = int.parse(user.patientIdentificationNo); if (BASE_URL.contains('uat')) { _requestInsertCOCItem.forDemo = true; } else { @@ -61,9 +52,7 @@ class FeedbackService extends BaseService { body['ProjectName'] = appointHistory.projectName; } - await baseAppClient - .post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { + await baseAppClient.post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); @@ -73,15 +62,34 @@ class FeedbackService extends BaseService { hasError = false; Map body = new Map(); body['IdentificationNo'] = user.patientIdentificationNo; - body['MobileNo'] = - "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); + body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); body['Searching_type'] = '1'; if (BASE_URL.contains('uat')) { body['ForDemo'] = true; } - await baseAppClient.post(GET_STATUS_FOR_COCO, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_STATUS_FOR_COCO, onSuccess: (dynamic response, int statusCode) { + cOCItemList = []; + response['ListCOCItems'].forEach((cOC) { + cOCItemList.add(COCItem.fromJson(cOC)); + }); + cOCItemList = cOCItemList.reversed.toList(); // Sort list in desc order + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async { + hasError = false; + Map body = new Map(); + body['IdentificationNo'] = idNumber; + body['MobileNo'] = countryCode + Utils.getPhoneNumberWithoutZero(phoneNumber); + body['Searching_type'] = "$type"; + if (BASE_URL.contains('uat')) { + body['ForDemo'] = true; + } + await baseAppClient.post(GET_STATUS_FOR_COCO, onSuccess: (dynamic response, int statusCode) { cOCItemList = []; response['ListCOCItems'].forEach((cOC) { cOCItemList.add(COCItem.fromJson(cOC)); @@ -97,12 +105,10 @@ class FeedbackService extends BaseService { hasError = false; Map body = new Map(); body['IsComingFromCOC'] = true; - baseAppClient.post(GET_PATIENT_AppointmentHistory, - onSuccess: (dynamic response, int statusCode) { + baseAppClient.post(GET_PATIENT_AppointmentHistory, onSuccess: (dynamic response, int statusCode) { appointHistoryList = []; response['AppoimentAllHistoryResultList'].forEach((appoint) { - appointHistoryList - .add(AppoitmentAllHistoryResultList.fromJson(appoint)); + appointHistoryList.add(AppoitmentAllHistoryResultList.fromJson(appoint)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/feedback/feedback_view_model.dart b/lib/core/viewModels/feedback/feedback_view_model.dart index 6cea3085..0aac283a 100644 --- a/lib/core/viewModels/feedback/feedback_view_model.dart +++ b/lib/core/viewModels/feedback/feedback_view_model.dart @@ -6,37 +6,18 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import '../../../locator.dart'; -enum MessageType { - ComplaintOnAnAppointment, - ComplaintWithoutAppointment, - Question, - Compliment, - Suggestion, - NON -} +enum MessageType { ComplaintOnAnAppointment, ComplaintWithoutAppointment, Question, Compliment, Suggestion, NON } class FeedbackViewModel extends BaseViewModel { FeedbackService _feedbackService = locator(); List get cOCItemList => _feedbackService.cOCItemList; + List get appointHistoryList => _feedbackService.appointHistoryList; - List get appointHistoryList => - _feedbackService.appointHistoryList; - - Future sendCOCItem( - {String title, - String details, - String cOCTypeName, - String attachment, - AppoitmentAllHistoryResultList appointHistory}) async { + Future sendCOCItem({String title, String details, String cOCTypeName, String attachment, AppoitmentAllHistoryResultList appointHistory}) async { setState(ViewState.BusyLocal); - await _feedbackService.sendCOCItem( - title: title, - details: details, - cOCTypeName: cOCTypeName, - attachment: attachment, - appointHistory: appointHistory); + await _feedbackService.sendCOCItem(title: title, details: details, cOCTypeName: cOCTypeName, attachment: attachment, appointHistory: appointHistory); if (_feedbackService.hasError) { error = _feedbackService.error; setState(ViewState.ErrorLocal); @@ -58,7 +39,18 @@ class FeedbackViewModel extends BaseViewModel { } } - Future getPatentAppointmentHistory() async { + searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async { + setState(ViewState.Busy); + await _feedbackService.searchFeedback(countryCode, phoneNumber, type, idNumber); + if (_feedbackService.hasError) { + error = _feedbackService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getPatentAppointmentHistory() async { setState(ViewState.Busy); await _feedbackService.getPatentAppointmentHistory(); if (_feedbackService.hasError) { diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 6ac4d557..269b336d 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -1,11 +1,17 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -18,6 +24,12 @@ class StatusFeedbackPage extends StatefulWidget { } class _StatusFeedbackPageState extends State { + String countryCode = '966'; + String mobileNo = ""; + TextEditingController complainNumberController = TextEditingController(); + StatusType statusType = StatusType.ComplaintNumber; + int selectedStatusIndex = 3; + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -29,116 +41,299 @@ class _StatusFeedbackPageState extends State { body: Column( children: [ Expanded( - child: model.cOCItemList.isNotEmpty - ? Container( - margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), - child: ListView.builder( - itemCount: model.cOCItemList.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - }, - child: Card( - shape: cardRadius(12), - margin: EdgeInsets.all(10), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(projectViewModel.isArabic ? model.cOCItemList[index].statusAr : model.cOCItemList[index].status, - style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Text(model.cOCItemList[index].formType.toString(), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - color: Color(0xff2B353E), - letterSpacing: -0.48, - height: 18 / 12))), - myRichText(TranslationBase.of(context).number + ": ", model.cOCItemList[index].itemID.toString(), projectViewModel.isArabic), - Text(model.cOCItemList[index].cOCTitle, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - color: Color(0xff2B353E), - letterSpacing: -0.48, - height: 18 / 12)), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text(model.cOCItemList[index].date.split(" ")[0], - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - color: Color(0xff2B353E), - letterSpacing: -0.48)), - Text(model.cOCItemList[index].date.split(" ")[1].substring(0, 4), - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', - color: Color(0xff2B353E), - letterSpacing: -0.48)), - ], - ), - ], - ), - ), + child: projectViewModel.isLogin + ? !model.cOCItemList.isNotEmpty + ? listData(model.cOCItemList, projectViewModel.isArabic, true) + : Center( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * 0.4, + ), + Image.asset( + 'assets/images/comments.png', + width: 80, + height: 80, + ), + SizedBox( + height: 15, + ), + Text( + TranslationBase.of(context).noSearchResult, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff2B353E), ), - )), - ) - : Center( + ), + ], + ), + ) + : SingleChildScrollView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: MediaQuery.of(context).size.height * 0.4, - ), - Image.asset( - 'assets/images/comments.png', - width: 80, - height: 80, - ), - SizedBox( - height: 15, - ), Text( - TranslationBase.of(context).noSearchResult, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - color: Color(0xff2B353E), + TranslationBase.of(context).selectSearchCriteria, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + SizedBox(height: 21), + InkWell( + onTap: () { + List list = [ + RadioSelectionDialogModel(TranslationBase.of(context).complaintNumber, 3), + RadioSelectionDialogModel(TranslationBase.of(context).fileNumber, 1), + RadioSelectionDialogModel(TranslationBase.of(context).identificationNumber, 2), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: selectedStatusIndex, + onValueSelected: (index) { + selectedStatusIndex = index; + setState(() { + if (index == 3) { + statusType = StatusType.ComplaintNumber; + } else if (index == 1) { + statusType = StatusType.FileNumber; + } else { + statusType = StatusType.IdentificationNumber; + } + }); + }, + ), + ); + }, + child: Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + getSelected(context), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff2B353E), + ), + ), + Icon( + Icons.keyboard_arrow_down, + size: 22, + color: Colors.grey, + ) + ], + ), ), ), + SizedBox(height: 12), + Directionality( + textDirection: TextDirection.ltr, + child: inputWidget( + statusType == StatusType.ComplaintNumber + ? TranslationBase.of(context).enterComplainNumber + : (statusType == StatusType.FileNumber ? TranslationBase.of(context).enterfileNumber : TranslationBase.of(context).enterIdentificationNumber), + "", + complainNumberController, + isInputTypeNum: true)), + SizedBox(height: 12), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + countryCode = value; + }); + }), ], ), ), ), + if (!projectViewModel.isLogin) + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).search, + projectViewModel.isLogin || (mobileNo.length < 9) || (complainNumberController.text.isEmpty) + ? null + : () { + model.searchFeedback(countryCode, mobileNo, selectedStatusIndex, complainNumberController.text).then((value) { + if (model.state == ViewState.ErrorLocal) { + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: model.error); + }); + } else { + listData(model.cOCItemList, projectViewModel.isArabic, false); + } + }); + }, + disabledColor: Colors.grey, + ), + ), ], ), - bottomSheet: Container( - color: Colors.white, - padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), - child: DefaultButton( - TranslationBase.of(context).search, - projectViewModel.isLogin ? null : () => {}, - disabledColor: Colors.grey, + ), + ); + } + + Widget listData(List cOCItemList, bool isArabic, bool isLogin) { + return ListView.builder( + padding: isLogin ? EdgeInsets.all(21) : null, + itemCount: cOCItemList.length, + shrinkWrap: isLogin ? false : true, + physics: isLogin ? null : NeverScrollableScrollPhysics(), + itemBuilder: (context, index) => InkWell( + onTap: () {}, + child: Card( + shape: cardRadius(12), + margin: EdgeInsets.all(10), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text(cOCItemList[index].formType.toString(), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))), + myRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic), + Text(cOCItemList[index].cOCTitle, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text(cOCItemList[index].date.split(" ")[0], + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), + Text(cOCItemList[index].date.split(" ")[1].substring(0, 4), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), + ], + ), + ], + ), ), ), ), ); } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } + gotodetails(item) { Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item))); } + + String getSelected(BuildContext context) { + switch (statusType) { + case StatusType.ComplaintNumber: + return TranslationBase.of(context).complaintNumber; + break; + case StatusType.FileNumber: + return TranslationBase.of(context).fileNumber; + break; + case StatusType.IdentificationNumber: + return TranslationBase.of(context).identificationNumber; + break; + } + return TranslationBase.of(context).notClassified; + } +} + +enum StatusType { + ComplaintNumber, + FileNumber, + IdentificationNumber, } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d663881f..529bd103 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -805,6 +805,12 @@ class TranslationBase { String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; + String get enterfileNumber => localizedValues['enterfileNumber'][locale.languageCode]; + + String get complaintNumber => localizedValues['complaintNumber'][locale.languageCode]; + + String get identificationNumber => localizedValues['identificationNumber'][locale.languageCode]; + String get amount => localizedValues['Amount'][locale.languageCode]; String get depositorEmail => localizedValues['DepositorEmail'][locale.languageCode]; @@ -1504,6 +1510,8 @@ class TranslationBase { String get selectAll => localizedValues['select-all'][locale.languageCode]; + String get select => localizedValues['select'][locale.languageCode]; + String get selectMap => localizedValues['select-map'][locale.languageCode]; String get noAppointment => localizedValues['no-appointment'][locale.languageCode]; @@ -2367,8 +2375,9 @@ class TranslationBase { String get appoPaymentConfirm => localizedValues["appoPaymentConfirm"][locale.languageCode]; + String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode]; - + String get enterComplainNumber => localizedValues["enterComplainNumber"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 07947508..b7e0f16b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -183,6 +183,8 @@ class Utils { String newNumber = ""; if (number.startsWith('0')) { newNumber = number.substring(1); + } else { + newNumber = number; } return newNumber; } diff --git a/lib/widgets/dialogs/radio_selection_dialog.dart b/lib/widgets/dialogs/radio_selection_dialog.dart new file mode 100644 index 00000000..198e25de --- /dev/null +++ b/lib/widgets/dialogs/radio_selection_dialog.dart @@ -0,0 +1,121 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:flutter/material.dart'; + +class RadioSelectionDialogModel { + String title; + int value; + + RadioSelectionDialogModel(this.title, this.value); +} + +class RadioSelectionDialog extends StatefulWidget { + final Function(int) onValueSelected; + final List listData; + final int selectedIndex; + + const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex}) : super(key: key); + + @override + State createState() => new RadioSelectionDialogState(); +} + +class RadioSelectionDialogState extends State { + int selectedIndex; + + @override + void initState() { + selectedIndex = widget.selectedIndex ?? 0; + super.initState(); + } + + Widget build(BuildContext context) { + return Dialog( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder(), + insetPadding: EdgeInsets.only(left: 21, right: 21), + child: Padding( + padding: EdgeInsets.only(left: 20, right: 20, top: 18, bottom: 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(top: 16.0), + child: Text( + TranslationBase.of(context).select, + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96), + ), + ), + ), + IconButton( + padding: EdgeInsets.zero, + icon: Icon(Icons.close), + color: Color(0xff2B353E), + constraints: BoxConstraints(), + onPressed: () { + Navigator.pop(context); + }, + ) + ], + ), + SizedBox(height: 21), + Text( + TranslationBase.of(context).pleaseSelectFromBelowOptions, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + ), + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(bottom: 42, top: 10), + itemBuilder: (context, index) { + return Row( + children: [ + SizedBox( + width: 22, + height: 22, + child: Radio( + value: widget.listData[index].value, + groupValue: selectedIndex, + onChanged: (value) { + setState(() { + selectedIndex = value; + }); + }, + ), + ), + SizedBox(width: 8), + Text( + widget.listData[index].title, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56), + ), + ], + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 10), + itemCount: widget.listData.length), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).save, + () { + Navigator.pop(context); + widget.onValueSelected(selectedIndex); + }, + color: Color(0xff349745), + ), + ), + ], + ), + ], + ), + ), + ); + } +} From 43c67a5a84fe1e511c0b2f62e5b9d56b77c78be2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Oct 2021 16:52:08 +0300 Subject: [PATCH 20/33] Notifications UI fix --- .../notifications/notifications_page.dart | 156 +++++++++--------- 1 file changed, 74 insertions(+), 82 deletions(-) diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 07356f01..89f40e4d 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -4,8 +4,8 @@ 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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -44,93 +44,85 @@ class NotificationsPage extends StatelessWidget { model.getNotifications(getNotificationsRequestModel, context); }, - builder: (_, model, widget) => - AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - appBarTitle: TranslationBase - .of(context) - .notifications, - baseViewModel: model, - body: ListView.separated( - itemBuilder: (context, index) { - return InkWell( - onTap: () async { - if (!model.notifications[index].isRead) { - model.markAsRead(model.notifications[index].id); - } - Navigator.push( - context, - FadePage( - page: NotificationsDetailsPage( - notification: model.notifications[index], - ))); - }, - child: Container( - width: double.infinity, - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: model.notifications[index].isRead ? Theme - .of(context) - .scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), - border: Border( - left: BorderSide( - color: model.notifications[index].isRead ? Theme - .of(context) - .scaffoldBackgroundColor : CustomColors.accentColor, - width: 5.0, - ), - ), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).notifications, + baseViewModel: model, + body: ListView.separated( + itemBuilder: (context, index) { + return InkWell( + onTap: () async { + if (!model.notifications[index].isRead) { + model.markAsRead(model.notifications[index].id); + } + Navigator.push( + context, + FadePage( + page: NotificationsDetailsPage( + notification: model.notifications[index], + ))); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + border: Border( + left: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, ), - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + - " " + - 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") - Icon( - FontAwesomeIcons.images, - color: CustomColors.grey, - ) - ], - ), - SizedBox( - height: 5, - ), + ), + ), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + " " + + 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") + Icon( + FontAwesomeIcons.images, + color: CustomColors.grey, + ) ], ), - ), + SizedBox( + height: 5, + ), + ], ), - ], - ), - ), - ); - }, - separatorBuilder: (context, index) { - return Column( - children: [ - Divider( - color: Colors.grey[300], - thickness: 2.0, + ), ), ], - ); - }, - itemCount: model.notifications.length) - ), + ), + ), + ); + }, + separatorBuilder: (context, index) { + return Column( + children: [ + Divider( + color: Colors.grey[300], + thickness: 2.0, + ), + ], + ); + }, + itemCount: model.notifications.length)), // ListView( // children: model.notifications // .map( From 9d30bf63d04b391e63d1333e028b68c0b8a7b5f0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Oct 2021 17:39:07 +0300 Subject: [PATCH 21/33] Notification page fix --- .../notifications/notifications_page.dart | 24 ++++++++++++------- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 89f40e4d..5a859fca 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -1,16 +1,17 @@ import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; 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'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; // ignore: must_be_immutable class NotificationsPage extends StatelessWidget { @@ -37,7 +38,7 @@ class NotificationsPage extends StatelessWidget { @override Widget build(BuildContext context) { - var prescriptionReport; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2); @@ -69,12 +70,19 @@ class NotificationsPage extends StatelessWidget { padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), - border: Border( - left: BorderSide( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, - width: 5.0, - ), - ), + border: projectViewModel.isArabic + ? Border( + right: BorderSide( + 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, + width: 5.0, + ), + ), ), child: Row( children: [ diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index ce0a86d3..0b96d8fe 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -360,7 +360,7 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage())); + if (!projectProvider.isLoginChild) Navigator.push(AppGlobal.context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3)) From 881644a22e81d7d7606e7ce9a03eae9ad2a81d15 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 17 Oct 2021 09:41:17 +0300 Subject: [PATCH 22/33] family files changes --- lib/config/config.dart | 4 ++-- lib/pages/DrawerPages/family/my-family.dart | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 18abad39..acb8d80a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// 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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index ad4494e6..49ad49ec 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -306,7 +306,7 @@ class _MyFamily extends State with TickerProviderStateMixin { child: IconButton( icon: Icon( Icons.check_circle, - color: Colors.black, + color: Color(0xff349745), ), onPressed: () { acceptRemoveRequest(result.iD, 3, context); @@ -363,7 +363,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Padding( padding: EdgeInsets.all(10), child: Row(children: [ - Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName, fontWeight: FontWeight.w600)), + Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), Expanded(flex: 2, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600)) ])), Divider(color: Colors.black, height: 1), @@ -418,8 +418,18 @@ class _MyFamily extends State with TickerProviderStateMixin { Padding( padding: EdgeInsets.all(10), child: Row(children: [ - Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)), - Expanded(flex: 1, child: AppText(TranslationBase.of(context).delete)), + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context).name, + fontWeight: FontWeight.w600, + )), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).delete, + fontWeight: FontWeight.w600, + )), ])), Divider(color: Colors.black), Column( From 6511ca8dc7034bf6464c27813453881c75796aed Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Oct 2021 13:05:36 +0300 Subject: [PATCH 23/33] UI fixes & updates --- .../service/feedback/feedback_service.dart | 2 +- .../Appointments/DoctorListResponse.dart | 6 +- .../GetDentalAppointmentsResponse.dart | 17 ++- .../orders_log_details_page.dart | 2 +- lib/pages/Blood/blood_donation.dart | 6 +- lib/pages/BookAppointment/BookConfirm.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 116 +++++++-------- .../Covid-DriveThru/covid-payment-alert.dart | 7 +- lib/pages/feedback/status_feedback_page.dart | 2 +- .../insurance_approval_detail_screen.dart | 8 +- .../livecare/widgets/LiveCareHistoryCard.dart | 7 +- .../balance/dialogs/SelectHospitalDialog.dart | 2 +- .../my_invoices/invoice_detail_page.dart | 15 +- .../medical/my_invoices/my_invoice_page.dart | 4 + .../my_trackers/Weight/WeightMonthlyPage.dart | 12 +- .../my_trackers/Weight/WeightWeeklyPage.dart | 21 +-- .../my_trackers/Weight/WeightYeaPage.dart | 7 +- .../blood_pressure/BloodPressureMonthly.dart | 12 +- .../blood_pressure/BloodPressureYeaPage.dart | 19 +-- .../bloodPressureWeeklyPage.dart | 22 +-- .../my_trackers/blood_suger/BloodMonthly.dart | 132 +----------------- .../my_trackers/blood_suger/BloodYeaPage.dart | 32 ++--- .../blood_suger/blood_sugar_weekly_page.dart | 20 ++- lib/pages/medical/reports/reports_page.dart | 2 +- lib/uitl/date_uitl.dart | 4 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- lib/widgets/new_design/doctor_header.dart | 1 + 27 files changed, 165 insertions(+), 319 deletions(-) diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 9e2245e6..37c0c7be 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -63,7 +63,7 @@ class FeedbackService extends BaseService { Map body = new Map(); body['IdentificationNo'] = user.patientIdentificationNo; body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); - body['Searching_type'] = '1'; + body['Searching_type'] = 1; if (BASE_URL.contains('uat')) { body['ForDemo'] = true; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 651165e4..0da1a273 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -40,6 +40,7 @@ class DoctorList { String setupID; List speciality; dynamic workingHours; + dynamic decimalDoctorRate; DoctorList( {this.clinicID, @@ -82,7 +83,8 @@ class DoctorList { this.serviceID, this.setupID, this.speciality, - this.workingHours}); + this.workingHours, + this.decimalDoctorRate}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -127,6 +129,7 @@ class DoctorList { if (json.containsKey('Speciality') && json['Speciality']!=null) speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; + decimalDoctorRate = json['DecimalDoctorRate']; } Map toJson() { @@ -172,6 +175,7 @@ class DoctorList { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['WorkingHours'] = this.workingHours; + data['DecimalDoctorRate'] = this.decimalDoctorRate; return data; } } diff --git a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart index a5a43cef..f7294f3c 100644 --- a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart +++ b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart @@ -34,10 +34,13 @@ class ListDentalAppointments { int invoiceNo; int status; String arrivedOn; - String doctorName; - dynamic doctorNameN; + dynamic doctorName; + String doctorNameN; String clinicName; + dynamic decimalDoctorRate; String doctorImageURL; + dynamic doctorRate; + int patientNumber; String projectName; ListDentalAppointments( @@ -55,7 +58,10 @@ class ListDentalAppointments { this.doctorName, this.doctorNameN, this.clinicName, + this.decimalDoctorRate, this.doctorImageURL, + this.doctorRate, + this.patientNumber, this.projectName}); ListDentalAppointments.fromJson(Map json) { @@ -73,7 +79,10 @@ class ListDentalAppointments { doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; clinicName = json['ClinicName']; + decimalDoctorRate = json['DecimalDoctorRate']; doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + patientNumber = json['PatientNumber']; projectName = json['ProjectName']; } @@ -93,8 +102,12 @@ class ListDentalAppointments { data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; data['ClinicName'] = this.clinicName; + data['DecimalDoctorRate'] = this.decimalDoctorRate; data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['PatientNumber'] = this.patientNumber; data['ProjectName'] = this.projectName; return data; } } + diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 12879ac9..f7b103d5 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -140,7 +140,7 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 1c861462..e3888240 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -96,8 +96,7 @@ class _BloodDonationPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).bloodDEnterDesc, - textAlign: TextAlign.center, + TranslationBase.of(context).bloodDEnterDesc ), SizedBox( height: 12, @@ -240,7 +239,8 @@ class _BloodDonationPageState extends State { ), bottomSheet: Container( width: double.infinity, - padding: EdgeInsets.all(12), + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(20), child: DefaultButton(TranslationBase.of(context).save, () async { if (_selectedHospital == null) { AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 2b49043e..e069eca6 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -401,7 +401,7 @@ class _BookConfirmState extends State { widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString(); }); - return widget.appoDateFormatted; + return DateUtil.getDayMonthYearDateFormatted(dateObj); } DateTime getDateTime() { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 84af56d6..15ccf128 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -214,55 +214,63 @@ class _BookSuccessState extends State { Widget _getConfirmAppoButtons() { return Container( - alignment: Alignment.bottomCenter, - margin: EdgeInsets.only(bottom: 5.0), - height: MediaQuery.of(context).size.height * 0.15, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.clinicID = widget.docObject.clinicID; - appo.projectID = widget.docObject.projectID; - appo.appointmentNo = widget.patientShareResponse.appointmentNo; - appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; - appo.doctorID = widget.patientShareResponse.doctorID; - confirmAppointment(appo); - }, - child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare.toUpperCase() : TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), + color: CustomColors.appBackgroudGreyColor, + child: Container( + color: CustomColors.appBackgroudGreyColor, + margin: EdgeInsets.all(14), + height: 45.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: new Color(0xffc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 18.0)), + ), + ), ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text(TranslationBase.of(context).confirmLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: CustomColors.green, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, + style: TextStyle(fontSize: 18.0)), + ), + ), ), - ), - ], + ], + ), ), ); } @@ -365,11 +373,7 @@ class _BookSuccessState extends State { ), ], ), - // Container( - // margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), - // child: Image.asset("assets/images/new-design/payment-method.png"), - // ), - Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()), ], ); } @@ -479,11 +483,9 @@ class _BookSuccessState extends State { appo.clinicID = widget.patientShareResponse.clinicID; appo.appointmentNo = widget.patientShareResponse.appointmentNo; - Navigator.push(context, FadePage(page: PaymentMethod( - onSelectedMethod: (String metohd) { - setState(() {}); - } - ))).then((value) { + Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { + setState(() {}); + }))).then((value) { if (value != null) { openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart index 9d2ac0a5..2d7d5363 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; -import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class CovidPaymentAlert extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -126,7 +124,7 @@ class _CovidPaymentAlertState extends State { ), mWidth(6), _getNormalText( - widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate)), isBold: true, ), ], @@ -139,7 +137,7 @@ class _CovidPaymentAlertState extends State { ), mWidth(6), _getNormalText( - widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL", + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate), false), isBold: true, ), ], @@ -230,7 +228,6 @@ class _CovidPaymentAlertState extends State { }); } - Navigator.push( context, FadePage( diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 269b336d..46a545a6 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -42,7 +42,7 @@ class _StatusFeedbackPageState extends State { children: [ Expanded( child: projectViewModel.isLogin - ? !model.cOCItemList.isNotEmpty + ? model.cOCItemList.isNotEmpty ? listData(model.cOCItemList, projectViewModel.isArabic, true) : Center( child: Column( diff --git a/lib/pages/insurance/insurance_approval_detail_screen.dart b/lib/pages/insurance/insurance_approval_detail_screen.dart index 2cc381d4..a1be5cf8 100644 --- a/lib/pages/insurance/insurance_approval_detail_screen.dart +++ b/lib/pages/insurance/insurance_approval_detail_screen.dart @@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget { myRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), SizedBox(height: 6), myRichText(TranslationBase.of(context).receiptOn, - DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "", projectViewModel.isArabic), myRichText(TranslationBase.of(context).expiryOn, - DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "", projectViewModel.isArabic), ], ), ), @@ -101,8 +101,8 @@ class InsuranceApprovalDetail extends StatelessWidget { TableRow( children: [ Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.procedureName ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(insuranceApprovalModel?.approvalStatusDescption ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.status ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc ?? '', isLast: true, mProjectViewModel: projectViewModel), ], ), ]) diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 785fcb71..d3029f86 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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/dialogs/confirm_dialog.dart'; @@ -60,7 +61,7 @@ class _LiveCareHistoryCardState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(widget.erRequestHistoryList.sArrivalTime, style: TextStyle(fontSize: 14.0)), + Text(DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)), style: TextStyle(fontSize: 14.0)), Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])), ], ), @@ -130,8 +131,8 @@ class _LiveCareHistoryCardState extends State { Icon(Icons.star, size: 24.0, color: Colors.yellow[700]), Container( width: MediaQuery.of(context).size.width * 0.2, - margin: EdgeInsets.only(left: 10.0), - child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)), + margin: EdgeInsets.only(left: 9.0), + child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 11.0)), ), ], ), diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart index 7605a879..fd47ea1b 100644 --- a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -50,7 +50,7 @@ class _SelectHospitalDialogState extends State { }, child: ListTile( title: Text( - widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM', + widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 0f35a96f..9a6a9b03 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/MyInvoices/DentalInvoiceDetailResponse.dart'; import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,15 +10,11 @@ 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/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/extensions/list_extension.dart'; class InvoiceDetail extends StatefulWidget { final DoctorList doctor; @@ -73,7 +68,8 @@ class _InvoiceDetailState extends State { widget.doctor.doctorRate, widget.doctor.actualDoctorRate, widget.doctor.noOfPatientsRate ?? 0, - projectViewModel.user.emailAddress), + projectViewModel.user.emailAddress, + decimalDoctorRate: widget.doctor.decimalDoctorRate.toString()), onTap: () { sendInvoiceEmail(); }, @@ -117,7 +113,12 @@ class _InvoiceDetailState extends State { margin: EdgeInsets.only(bottom: 10.0), child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)), ), - myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic), + myRichText( + TranslationBase.of(context).insuranceCompany + ": ", + projectViewModel.isArabic + ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].groupNameN + : widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, + projectViewModel.isArabic), myRichText( TranslationBase.of(context).insuranceID + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A", diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index d13a0599..820bf355 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -97,6 +97,10 @@ class _MyInvoicesState extends State { doctor.dayName = listDentalAppointments.invoiceNo; doctor.clinicName = listDentalAppointments.invoiceNo.toString(); doctor.date = listDentalAppointments.appointmentDate; + doctor.noOfPatientsRate = listDentalAppointments.patientNumber; + doctor.actualDoctorRate = listDentalAppointments.doctorRate; + doctor.decimalDoctorRate = listDentalAppointments.decimalDoctorRate; + doctor.doctorID = listDentalAppointments.doctorID; myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index ff5a707d..3cc02dba 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -8,12 +7,10 @@ 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/charts/app_time_series_chart.dart'; -import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class WeightMonthlyPage extends StatelessWidget { final WeightPressureViewModel model; @@ -26,7 +23,6 @@ class WeightMonthlyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, @@ -43,7 +39,6 @@ class WeightMonthlyPage extends StatelessWidget { timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData, indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, ), - ), Card( shape: cardRadius(12), @@ -81,7 +76,7 @@ class WeightMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(2.5), // 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]) @@ -97,7 +92,7 @@ class WeightMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -113,8 +108,7 @@ class WeightMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), ], diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 54891563..6725874f 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -12,7 +11,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'AddWeightPage.dart'; @@ -23,23 +21,11 @@ class WeightWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( isShowDecPage: false, backgroundColor: CustomColors.appBackgroudGrey2Color, body: ListView( children: [ - // Container( - // margin: EdgeInsets.only(top: 12, left: 8, right: 8), - // color: Colors.white, - // child: LineChartCurved( - // horizontalInterval: 1.0, - // title: TranslationBase.of(context).weight, - // timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData, - // indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, - // ), - // ), Card( shape: cardRadius(12), elevation: 1, @@ -78,7 +64,7 @@ class WeightWeeklyPage extends StatelessWidget { columnWidths: { 0: FlexColumnWidth(2.5), }, - children: fullData(context, projectViewModel, model), + children: fullData(context, model), ), ], ), @@ -92,7 +78,7 @@ class WeightWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { + List fullData(BuildContext context, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( @@ -109,8 +95,7 @@ class WeightWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index efa3393d..c0c2142b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -25,7 +25,6 @@ class WeightYearPage extends StatelessWidget { List monthlyGroup = []; @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, @@ -76,7 +75,7 @@ class WeightYearPage extends StatelessWidget { columnWidths: { 0: FlexColumnWidth(2.5), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -91,7 +90,7 @@ class WeightYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -107,7 +106,7 @@ class WeightYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart index 8f79bb34..049636a9 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -1,6 +1,5 @@ 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/MonthCurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,16 +9,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodPressureMonthlyPage extends StatelessWidget { final BloodPressureViewMode model; BloodPressureMonthlyPage({Key key, this.model}) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( body: ListView( @@ -67,7 +65,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -80,7 +78,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -97,9 +95,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)}', isCapitable: false), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false), Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart index c31b5f5c..1b1334e9 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -1,6 +1,5 @@ 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/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,16 +9,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodPressureYearPage extends StatelessWidget { final BloodPressureViewMode model; BloodPressureYearPage({Key key, this.model}) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( body: ListView( @@ -28,7 +26,8 @@ class BloodPressureYearPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, child: CurvedChartBloodPressure( - horizontalInterval: 3.0, // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, + horizontalInterval: 3.0, + // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, 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, @@ -38,10 +37,6 @@ class BloodPressureYearPage extends StatelessWidget { SizedBox( height: 12, ), - // Padding( - // padding: const EdgeInsets.all(8.0), - // child: Texts(TranslationBase.of(context).details), - // ), Container( padding: EdgeInsets.all(10), color: Colors.transparent, @@ -67,7 +62,7 @@ class BloodPressureYearPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -80,7 +75,7 @@ class BloodPressureYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -97,9 +92,7 @@ class BloodPressureYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)}', isCapitable: false), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false), Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 5d39d2e8..f3bdb057 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -1,17 +1,15 @@ 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'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; + import 'AddBloodPressurePage.dart'; class BloodPressureWeeklyPage extends StatelessWidget { @@ -21,7 +19,6 @@ class BloodPressureWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ @@ -35,13 +32,6 @@ class BloodPressureWeeklyPage extends StatelessWidget { timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, ), - // CurvedChartBloodPressure( - // horizontalInterval: 3.0, - // title: TranslationBase.of(context).bloodPressure, - // timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop, - // timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow, - // indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, - // ), ), SizedBox( height: 12, @@ -67,7 +57,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, model), + children: fullData(context, model), ), SizedBox(height: 80) ], @@ -78,7 +68,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) { + List fullData(BuildContext context, BloodPressureViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -96,7 +86,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false), Utils.tableColumnValue(diabtec.bloodPressureDate.hour.toString() + ':' + diabtec.bloodPressureDate.minute.toString(), isCapitable: false), Utils.tableColumnValue('${diabtec.measuredArmDesc}', isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), @@ -121,7 +111,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ), ).then((value) { model.getBloodPressure(); - if(model.weekDiabtecPatientResult.isEmpty) { + if (model.weekDiabtecPatientResult.isEmpty) { model.weightWeekTimeSeriesDataTop.clear(); model.weightWeekTimeSeriesDataLow.clear(); } diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index 5a3710e5..72e2e58b 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -1,7 +1,6 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodMonthlyPage extends StatelessWidget { final List diabtecPatientResult; @@ -24,10 +22,8 @@ class BloodMonthlyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( @@ -69,7 +65,7 @@ class BloodMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -79,7 +75,7 @@ class BloodMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, e) { + List fullData(BuildContext context, e) { List tableRow = []; tableRow.add( TableRow( @@ -88,71 +84,6 @@ class BloodMonthlyPage extends StatelessWidget { Utils.tableColumnTitle(TranslationBase.of(context).time), Utils.tableColumnTitle(TranslationBase.of(context).measured), Utils.tableColumnTitle(TranslationBase.of(context).value), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), - // topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), - // ), - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).date, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40, - // ), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).time, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).measured, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), - // topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), - // ), - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).value, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), ], ), ); @@ -161,67 +92,10 @@ class BloodMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.measuredDesc}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.resultValue}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index d4e1698e..4b3b4152 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -1,17 +1,15 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodYearPage extends StatelessWidget { final List diabtecPatientResult; @@ -20,23 +18,24 @@ class BloodYearPage extends StatelessWidget { BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key); List yearlyGroup = []; + @override Widget build(BuildContext context) { groupData(); - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( - margin: EdgeInsets.only(top: 12, left: 8, right: 8), - width: double.maxFinite, - color: Colors.white, - child: LineChartCurved( - title: '${TranslationBase.of(context).bloodSugar}', - timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5 ?? 0, - )), + margin: EdgeInsets.only(top: 12, left: 8, right: 8), + width: double.maxFinite, + color: Colors.white, + child: ShowChart( + title: TranslationBase.of(context).weight, + timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 2, + ), + ), SizedBox( height: 12, ), @@ -69,7 +68,7 @@ class BloodYearPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -82,7 +81,7 @@ class BloodYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, yearlyGroup) { + List fullData(BuildContext context, yearlyGroup) { List tableRow = []; tableRow.add( TableRow( @@ -99,8 +98,7 @@ class BloodYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 7921d030..d1728610 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -1,18 +1,16 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'AddBloodSugarPage.dart'; @@ -25,18 +23,17 @@ class BloodSugarWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: LineChartCurved( - title: '${TranslationBase.of(AppGlobal.context).bloodSugar}', + child: ShowChart( + title: TranslationBase.of(context).weight, timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 2, ), ), SizedBox( @@ -63,7 +60,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, bloodSugarViewMode), + children: fullData(context, bloodSugarViewMode), ), SizedBox( height: 80, @@ -76,7 +73,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) { + List fullData(BuildContext context, BloodSugarViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -94,8 +91,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), @@ -119,7 +115,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ), ), ).then((value) { - if(bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { + if (bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { timeSeriesData.clear(); } }); diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index c7da70cf..3fa6ce39 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -74,7 +74,7 @@ class MedicalReports extends StatelessWidget { style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), Text( - DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), ], diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 34585002..337d4af0 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -419,9 +419,7 @@ class DateUtil { "/" + dateTime.year.toString() + " " + - dateTime.hour.toString() + - ":" + - dateTime.minute.toString(); + DateFormat('HH:mm').format(dateTime); else return ""; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index d50420ab..e24fd6f0 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -174,7 +174,7 @@ class MyInAppBrowser extends InAppBrowser { applePayInsertRequest.longitude = this.long.toString(); applePayInsertRequest.amount = amount.toString(); applePayInsertRequest.isSchedule = "0"; - applePayInsertRequest.language = getLanguageID() == 'ar' ? 'AR' : 'EN'; + applePayInsertRequest.language = await getLanguageID() == 'ar' ? 'AR' : 'EN'; applePayInsertRequest.userName = authenticatedUser.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; @@ -219,7 +219,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authUser, bool isLiveCareAppo, var servID, var LiveServID, [var appoDate, var appoNo, var clinicID, var doctorID, var patientData]) async { getDeviceToken(); - String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; + String currentLanguageID = await getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = isLiveCareAppo ? getLiveCareForm() : getForm(); form = form.replaceFirst("EMAIL_VALUE", emailId); diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index ed93fe59..d2ff291e 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -197,6 +197,7 @@ class DoctorHeader extends StatelessWidget { res['DoctorRatingDetailsList'].forEach((v) { doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); }); + this.headerModel.decimalDoctorRate = res['DecimalDoctorRate'].toString(); showRatingDialog(doctorDetailsList, context); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); From 0b4305de031b84147825423e57eda525da8aa3dc Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 17 Oct 2021 13:58:34 +0300 Subject: [PATCH 24/33] all dialog changes and improvements (cont). --- lib/config/config.dart | 4 +- .../h2o/Dialog/confirm_add_amount_dialog.dart | 194 ++++----- .../h2o/Dialog/select_amount_dialog.dart | 318 +++++++-------- .../h2o/add_custom_amount.dart | 241 ++++++------ .../AlHabibMedicalService/h2o/today_page.dart | 18 +- .../widgets/h20_floating_action_button.dart | 370 +++++++++--------- .../EdOnline/ConfirmExitPageDialog.dart | 144 +++---- .../ErService/EdOnline/DdServicesPage.dart | 39 +- lib/pages/feedback/send_feedback_page.dart | 95 ++++- lib/pages/landing/landing_page.dart | 11 +- lib/pages/medical/reports/reports_page.dart | 263 +++++-------- 11 files changed, 840 insertions(+), 857 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 18abad39..acb8d80a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// 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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 33e874db..0197873b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -4,101 +4,101 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +// todo 'sikander' remove useless code // ignore: must_be_immutable -class ConfirmAddAmountDialog extends StatefulWidget { - final int amount; - final String unit; - final H2OViewModel model; - - ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); - - @override - _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); -} - -class _ConfirmAddAmountDialogState extends State { - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - return SimpleDialog( - contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), - titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), - title: Center( - child: Texts( - TranslationBase.of(context).confirm, - textAlign: TextAlign.center, - color: Colors.black, - ), - ), - children: [ - Column( - children: [ - Divider(), - Center( - child: Texts( - "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", - textAlign: TextAlign.center, - color: Colors.grey, - ), - ), - SizedBox( - height: 16.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () async { - InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); - await widget.model.insertUserActivity(insertUserActivityRequestModel); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok.toUpperCase(), - fontWeight: FontWeight.w400, - )), - ), - ), - ), - ], - ), - ], - ) - ], - ); - } -} +// class ConfirmAddAmountDialog extends StatefulWidget { +// final int amount; +// final String unit; +// final H2OViewModel model; +// +// ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); +// +// @override +// _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); +// } +// +// class _ConfirmAddAmountDialogState extends State { +// @override +// void initState() { +// super.initState(); +// } +// +// @override +// Widget build(BuildContext context) { +// return SimpleDialog( +// contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), +// titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), +// title: Center( +// child: Texts( +// TranslationBase.of(context).confirm, +// textAlign: TextAlign.center, +// color: Colors.black, +// ), +// ), +// children: [ +// Column( +// children: [ +// Divider(), +// Center( +// child: Texts( +// "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", +// textAlign: TextAlign.center, +// color: Colors.grey, +// ), +// ), +// SizedBox( +// height: 16.0, +// ), +// Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).cancel.toUpperCase(), +// color: Colors.red, +// ), +// ), +// ), +// ), +// ), +// ), +// Container( +// width: 1, +// height: 30, +// color: Colors.grey[500], +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () async { +// InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); +// await widget.model.insertUserActivity(insertUserActivityRequestModel); +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Texts( +// TranslationBase.of(context).ok.toUpperCase(), +// fontWeight: FontWeight.w400, +// )), +// ), +// ), +// ), +// ], +// ), +// ], +// ) +// ], +// ); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart index 2df90419..4d02c27b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -4,163 +4,163 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +// todo 'sikander' remove useless code // ignore: must_be_immutable -class SelectAmountDialog extends StatefulWidget { - final Function(AmountModel) onValueSelected; - AmountModel selectedAmount; - - SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); - - @override - _SelectAmountDialogState createState() => _SelectAmountDialogState(); -} - -class _SelectAmountDialogState extends State { - List searchAmount = [ - AmountModel(name: "l", nameAr: "لتر", value: 1), - AmountModel(name: "ml", nameAr: "مم لتر", value: 2), - ]; - @override - void initState() { - super.initState(); - widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; - getLanguage(); - } - - String languageID = "en"; - - void getLanguage() async { - languageID = await sharedPref.getString(APP_LANGUAGE); - setState(() {}); - } - - @override - Widget build(BuildContext context) { - return SimpleDialog( - children: [ - Column( - children: [ - Texts( - TranslationBase.of(context).preferredunit, - fontSize: 20, - ), - Divider(), - ...List.generate( - searchAmount.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 2, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - widget.selectedAmount = searchAmount[index]; - }); - }, - child: ListTile( - title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), - leading: Radio( - value: searchAmount[index], - groupValue: widget.selectedAmount, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - widget.selectedAmount = value; - }); - }, - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - ], - ), - ), - SizedBox( - height: 5.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(widget.selectedAmount); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), - ), - ), - ], - ) - ], - ) - ], - ); - } -} - -class AmountModel { - String name; - String nameAr; - int value; - - AmountModel({this.name, this.nameAr, this.value}); - - AmountModel.fromJson(Map json) { - name = json['name']; - nameAr = json['nameAr']; - value = json['value']; - } - - Map toJson() { - final Map data = new Map(); - data['name'] = this.name; - data['nameAr'] = this.nameAr; - data['value'] = this.value; - return data; - } -} +// class SelectAmountDialog extends StatefulWidget { +// final Function(AmountModel) onValueSelected; +// AmountModel selectedAmount; +// +// SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); +// +// @override +// _SelectAmountDialogState createState() => _SelectAmountDialogState(); +// } +// +// class _SelectAmountDialogState extends State { +// List searchAmount = [ +// AmountModel(name: "l", nameAr: "لتر", value: 1), +// AmountModel(name: "ml", nameAr: "مم لتر", value: 2), +// ]; +// @override +// void initState() { +// super.initState(); +// widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; +// getLanguage(); +// } +// +// String languageID = "en"; +// +// void getLanguage() async { +// languageID = await sharedPref.getString(APP_LANGUAGE); +// setState(() {}); +// } +// +// @override +// Widget build(BuildContext context) { +// return SimpleDialog( +// children: [ +// Column( +// children: [ +// Texts( +// TranslationBase.of(context).preferredunit, +// fontSize: 20, +// ), +// Divider(), +// ...List.generate( +// searchAmount.length, +// (index) => Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// SizedBox( +// height: 2, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// setState(() { +// widget.selectedAmount = searchAmount[index]; +// }); +// }, +// child: ListTile( +// title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), +// leading: Radio( +// value: searchAmount[index], +// groupValue: widget.selectedAmount, +// activeColor: Colors.red[800], +// onChanged: (value) { +// setState(() { +// widget.selectedAmount = value; +// }); +// }, +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// ], +// ), +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).cancel.toUpperCase(), +// color: Colors.red, +// ), +// ), +// ), +// ), +// ), +// ), +// Container( +// width: 1, +// height: 30, +// color: Colors.grey[500], +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// widget.onValueSelected(widget.selectedAmount); +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Texts( +// TranslationBase.of(context).ok, +// fontWeight: FontWeight.w400, +// )), +// ), +// ), +// ), +// ], +// ) +// ], +// ) +// ], +// ); +// } +// } +// +// class AmountModel { +// String name; +// String nameAr; +// int value; +// +// AmountModel({this.name, this.nameAr, this.value}); +// +// AmountModel.fromJson(Map json) { +// name = json['name']; +// nameAr = json['nameAr']; +// value = json['value']; +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['name'] = this.name; +// data['nameAr'] = this.nameAr; +// data['value'] = this.value; +// return data; +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart index 2b22a100..641f6df7 100644 --- a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart +++ b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart @@ -10,123 +10,124 @@ import 'package:flutter/material.dart'; import 'Dialog/select_amount_dialog.dart'; -class AddCustomAmount extends StatefulWidget { - final H2OViewModel model; - final Function changePageViewIndex; - - const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) - : super(key: key); - - @override - _AddCustomAmountState createState() => _AddCustomAmountState(); -} - -class _AddCustomAmountState extends State { - TextEditingController _nameTextController = TextEditingController(); - AmountModel selectedAmount; - - @override - void initState() { - setState(() { - _nameTextController.text = "0"; - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle:TranslationBase.of(context).customLabel, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).h2oAmountOfWater, - // type: "Number", - controller: _nameTextController, - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmAmountTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getAmountName()), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), - SizedBox( - height: 12, - ), - SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).ok, - onTap: () async { - Navigator.of(context).pop(); - showConfirmMessage (int.parse(_nameTextController.text), widget.model); - }, - // loading: model.state == ViewState.BusyLocal, - disabled: _nameTextController.text.isEmpty || selectedAmount == null), - SizedBox( - height: 12, - ), - ], - ), - ), - ), - ), - ), - ); - } - - -void confirmAmountTypeDialog() { - showDialog( - context: context, - child: SelectAmountDialog( - selectedAmount: selectedAmount, - onValueSelected: (value) { - setState(() { - selectedAmount = value; - }); - }, - ), - ); -} - - - String getAmountName() { - if (selectedAmount != null) - return selectedAmount.name; - else - return TranslationBase.of(context).selectUnit; - } - - - - void showConfirmMessage(int amount, H2OViewModel model) { - showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); - } -} +// todo 'sikander' remove useless code +// class AddCustomAmount extends StatefulWidget { +// final H2OViewModel model; +// final Function changePageViewIndex; +// +// const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) +// : super(key: key); +// +// @override +// _AddCustomAmountState createState() => _AddCustomAmountState(); +// } +// +// class _AddCustomAmountState extends State { +// TextEditingController _nameTextController = TextEditingController(); +// AmountModel selectedAmount; +// +// @override +// void initState() { +// setState(() { +// _nameTextController.text = "0"; +// }); +// super.initState(); +// } +// +// @override +// Widget build(BuildContext context) { +// return AppScaffold( +// isShowAppBar: true, +// appBarTitle:TranslationBase.of(context).customLabel, +// body: SingleChildScrollView( +// physics: ScrollPhysics(), +// child: Container( +// margin: EdgeInsets.all(12), +// child: Center( +// child: FractionallySizedBox( +// widthFactor: 0.94, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// SizedBox( +// height: 12, +// ), +// NewTextFields( +// hintText: TranslationBase.of(context).h2oAmountOfWater, +// // type: "Number", +// controller: _nameTextController, +// ), +// SizedBox( +// height: 12, +// ), +// InkWell( +// onTap: () => confirmAmountTypeDialog(), +// child: Container( +// padding: EdgeInsets.all(12), +// width: double.infinity, +// height: 65, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(12), +// color: Colors.white), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts(getAmountName()), +// Icon(Icons.arrow_drop_down) +// ], +// ), +// ), +// ), +// SizedBox( +// height: 12, +// ), +// SecondaryButton( +// textColor: Colors.white, +// label: TranslationBase.of(context).ok, +// onTap: () async { +// Navigator.of(context).pop(); +// showConfirmMessage (int.parse(_nameTextController.text), widget.model); +// }, +// // loading: model.state == ViewState.BusyLocal, +// disabled: _nameTextController.text.isEmpty || selectedAmount == null), +// SizedBox( +// height: 12, +// ), +// ], +// ), +// ), +// ), +// ), +// ), +// ); +// } +// +// +// void confirmAmountTypeDialog() { +// showDialog( +// context: context, +// child: SelectAmountDialog( +// selectedAmount: selectedAmount, +// onValueSelected: (value) { +// setState(() { +// selectedAmount = value; +// }); +// }, +// ), +// ); +// } +// +// +// String getAmountName() { +// if (selectedAmount != null) +// return selectedAmount.name; +// else +// return TranslationBase.of(context).selectUnit; +// } +// +// +// +// void showConfirmMessage(int amount, H2OViewModel model) { +// showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 85c3544c..583dabbf 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -302,25 +302,11 @@ class _TodayPageState extends State { ); } - Widget _circularButton(context, int value, model, {bool isCustom = false}) { + Widget _circularButton(context, int value, model) { String _text = "$value${TranslationBase.of(context).ml}"; - if (isCustom) { - _text = TranslationBase.of(context).custom; - } return InkWell( onTap: () { - if (isCustom) { - Navigator.push( - context, - FadePage( - page: AddCustomAmount( - model: model, - ), - ), - ); - } else { - showConfirmMessage(context, value, model); - } + showConfirmMessage(context, value, model); }, child: Container( padding: EdgeInsets.all(21), diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 59a0a386..9b876cc1 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -9,189 +9,193 @@ import 'package:flutter/material.dart'; import '../add_custom_amount.dart'; -class H20FloatingActionButton extends StatefulWidget { - const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key); - final H2OViewModel model; +// todo 'sikander' remove useless code - @override - _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); -} -class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { - AnimationController _controller; - @override - void initState() { - _controller = new AnimationController( - vsync: this, - duration: const Duration(milliseconds: 500), - ); - super.initState(); - } - - void showConfirmMessage(int amount, H2OViewModel model) { - showDialog( - context: context, - child: ConfirmAddAmountDialog( - model: model, - amount: amount, - ), - ); - } - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(left: 20, right: 20), - child: new Column(mainAxisSize: MainAxisSize.min, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - ActionButton( - controller: _controller, - text: "600${TranslationBase.of(context).ml}", - onTap: () { - showConfirmMessage(600, widget.model); - }, - ), - ActionButton( - controller: _controller, - text: "330${TranslationBase.of(context).ml}", - onTap: () { - showConfirmMessage(330, widget.model); - }, - ), - ActionButton( - controller: _controller, - text: "200${TranslationBase.of(context).ml}", - onTap: () { - showConfirmMessage(200, widget.model); - }, - ), - ], - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - FloatingActionButton( - heroTag: null, - child: new AnimatedBuilder( - animation: _controller, - builder: (BuildContext context, Widget child) { - return new Transform( - transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi), - alignment: FractionalOffset.center, - child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), - ); - }, - ), - onPressed: () { - if (_controller.isDismissed) { - _controller.forward(); - } else { - _controller.reverse(); - } - }, - ), - new Container( - margin: EdgeInsets.only(left: 8, bottom: 4), - alignment: FractionalOffset.topCenter, - child: new ScaleTransition( - scale: new CurvedAnimation( - parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), - ), - child: new FloatingActionButton( - backgroundColor: Colors.white, - heroTag: null, - // mini: true, - child: Text( - TranslationBase.of(context).custom, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12, color: Colors.grey), - ), - onPressed: () { - Navigator.push( - context, - FadePage( - page: AddCustomAmount( - model: widget.model, - ), - ), - ); - }, - ), - ), - ), - new Container( - margin: EdgeInsets.only(left: 8, bottom: 4), - alignment: FractionalOffset.topCenter, - child: new ScaleTransition( - scale: new CurvedAnimation( - parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), - ), - child: new FloatingActionButton( - backgroundColor: Colors.white, - heroTag: null, - //mini: true, - child: Text( - TranslationBase.of(context).undo, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12.0, color: Colors.grey), - ), - onPressed: undoVolume, - ), - ), - ), - ], - ), - ]), - ); - } - - void undoVolume() async { - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.undoUserActivity(); - GifLoaderDialogUtils.hideDialog(context); - } -} - -class ActionButton extends StatelessWidget { - const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap}) - : _controller = controller, - super(key: key); - - final AnimationController _controller; - final String text; - final Function onTap; - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(left: 4, bottom: 8), - alignment: FractionalOffset.topCenter, - child: new ScaleTransition( - scale: new CurvedAnimation( - parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), - ), - child: new FloatingActionButton( - heroTag: null, - backgroundColor: Colors.white, - //mini: true, - child: Text( - text, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12.0, color: Colors.grey), - ), - onPressed: onTap), - ), - ); - } -} +// class H20FloatingActionButton extends StatefulWidget { +// const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key); +// +// final H2OViewModel model; +// +// @override +// _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); +// } +// +// class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { +// AnimationController _controller; +// @override +// void initState() { +// _controller = new AnimationController( +// vsync: this, +// duration: const Duration(milliseconds: 500), +// ); +// super.initState(); +// } +// +// void showConfirmMessage(int amount, H2OViewModel model) { +// showDialog( +// context: context, +// child: ConfirmAddAmountDialog( +// model: model, +// amount: amount, +// ), +// ); +// } +// +// @override +// Widget build(BuildContext context) { +// return Container( +// margin: EdgeInsets.only(left: 20, right: 20), +// child: new Column(mainAxisSize: MainAxisSize.min, children: [ +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Column( +// crossAxisAlignment: CrossAxisAlignment.end, +// children: [ +// ActionButton( +// controller: _controller, +// text: "600${TranslationBase.of(context).ml}", +// onTap: () { +// showConfirmMessage(600, widget.model); +// }, +// ), +// ActionButton( +// controller: _controller, +// text: "330${TranslationBase.of(context).ml}", +// onTap: () { +// showConfirmMessage(330, widget.model); +// }, +// ), +// ActionButton( +// controller: _controller, +// text: "200${TranslationBase.of(context).ml}", +// onTap: () { +// showConfirmMessage(200, widget.model); +// }, +// ), +// ], +// ), +// ], +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// FloatingActionButton( +// heroTag: null, +// child: new AnimatedBuilder( +// animation: _controller, +// builder: (BuildContext context, Widget child) { +// return new Transform( +// transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi), +// alignment: FractionalOffset.center, +// child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), +// ); +// }, +// ), +// onPressed: () { +// if (_controller.isDismissed) { +// _controller.forward(); +// } else { +// _controller.reverse(); +// } +// }, +// ), +// new Container( +// margin: EdgeInsets.only(left: 8, bottom: 4), +// alignment: FractionalOffset.topCenter, +// child: new ScaleTransition( +// scale: new CurvedAnimation( +// parent: _controller, +// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), +// ), +// child: new FloatingActionButton( +// backgroundColor: Colors.white, +// heroTag: null, +// // mini: true, +// child: Text( +// TranslationBase.of(context).custom, +// textAlign: TextAlign.center, +// style: TextStyle(fontSize: 12, color: Colors.grey), +// ), +// onPressed: () { +// Navigator.push( +// context, +// FadePage( +// page: AddCustomAmount( +// model: widget.model, +// ), +// ), +// ); +// }, +// ), +// ), +// ), +// new Container( +// margin: EdgeInsets.only(left: 8, bottom: 4), +// alignment: FractionalOffset.topCenter, +// child: new ScaleTransition( +// scale: new CurvedAnimation( +// parent: _controller, +// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), +// ), +// child: new FloatingActionButton( +// backgroundColor: Colors.white, +// heroTag: null, +// //mini: true, +// child: Text( +// TranslationBase.of(context).undo, +// textAlign: TextAlign.center, +// style: TextStyle(fontSize: 12.0, color: Colors.grey), +// ), +// onPressed: undoVolume, +// ), +// ), +// ), +// ], +// ), +// ]), +// ); +// } +// +// void undoVolume() async { +// GifLoaderDialogUtils.showMyDialog(context); +// await widget.model.undoUserActivity(); +// GifLoaderDialogUtils.hideDialog(context); +// } +// } +// +// class ActionButton extends StatelessWidget { +// const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap}) +// : _controller = controller, +// super(key: key); +// +// final AnimationController _controller; +// final String text; +// final Function onTap; +// +// @override +// Widget build(BuildContext context) { +// return Container( +// margin: EdgeInsets.only(left: 4, bottom: 8), +// alignment: FractionalOffset.topCenter, +// child: new ScaleTransition( +// scale: new CurvedAnimation( +// parent: _controller, +// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), +// ), +// child: new FloatingActionButton( +// heroTag: null, +// backgroundColor: Colors.white, +// //mini: true, +// child: Text( +// text, +// textAlign: TextAlign.center, +// style: TextStyle(fontSize: 12.0, color: Colors.grey), +// ), +// onPressed: onTap), +// ), +// ); +// } +// } diff --git a/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart b/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart index 1144e587..b31d4a38 100644 --- a/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart +++ b/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart @@ -2,75 +2,75 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - -class ConfirmExitPageDialog extends StatelessWidget { - final GestureTapCallback onTapYes; - final GestureTapCallback onTapNo; - - const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return SimpleDialog( - contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), - title: Center( - child: Texts( - TranslationBase.of(context).confirm, - color: Colors.black, - ), - ), - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts( - "Are you sure you want to exit this page ?", - color: Colors.grey, - ), - SizedBox( - height: 5, - ), - Divider(), - SizedBox( - height: 5.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - onTap: () { - onTapNo(); - }, - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).no, - color: Colors.red, - ), - ), - ), - ), - - InkWell( - onTap: () { - Navigator.pop(context); - onTapYes(); - }, - child: Container( - child: Center( - child: Texts(TranslationBase.of(context).yes), - ), - ), - ), - ], - ), - SizedBox( - height: 20.0, - ), - ], - ) - ], - ); - } -} +// todo 'sikander' remove useless code +// class ConfirmExitPageDialog extends StatelessWidget { +// final GestureTapCallback onTapYes; +// final GestureTapCallback onTapNo; +// +// const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo}) +// : super(key: key); +// +// @override +// Widget build(BuildContext context) { +// return SimpleDialog( +// contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), +// title: Center( +// child: Texts( +// TranslationBase.of(context).confirm, +// color: Colors.black, +// ), +// ), +// children: [ +// Column( +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Texts( +// "Are you sure you want to exit this page ?", +// color: Colors.grey, +// ), +// SizedBox( +// height: 5, +// ), +// Divider(), +// SizedBox( +// height: 5.0, +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// InkWell( +// onTap: () { +// onTapNo(); +// }, +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).no, +// color: Colors.red, +// ), +// ), +// ), +// ), +// +// InkWell( +// onTap: () { +// Navigator.pop(context); +// onTapYes(); +// }, +// child: Container( +// child: Center( +// child: Texts(TranslationBase.of(context).yes), +// ), +// ), +// ), +// ], +// ), +// SizedBox( +// height: 20.0, +// ), +// ], +// ) +// ], +// ); +// } +// } diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index edab81c1..457e199c 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -30,14 +30,12 @@ class _DdServicesPageState extends State { void initState() { super.initState(); pageController = new PageController(); - } _changePageViewIndex(int tab) { setState(() { pageController.jumpToPage(tab); - pageController.animateToPage(tab, - duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); }); } @@ -99,25 +97,28 @@ class _DdServicesPageState extends State { selectedQuestions: selectedQuestions, triageInformationRequest: triageInformationRequest, ), - EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,) + EdPaymentInformationPage( + selectedHospital: triageInformationRequest.selectedHospital, + ) ], ), ); } - void showConfirmMessage( - BuildContext context, - ) { - showDialog( - context: context, - child: ConfirmExitPageDialog( - onTapYes: () { - Navigator.pop(context); - }, - onTapNo: () { - Navigator.pop(context); - }, - ), - ); - } + // todo 'sikander' remove useless code + // void showConfirmMessage( + // BuildContext context, + // ) { + // showDialog( + // context: context, + // child: ConfirmExitPageDialog( + // onTapYes: () { + // Navigator.pop(context); + // }, + // onTapNo: () { + // Navigator.pop(context); + // }, + // ), + // ); + // } } diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index a95fb425..731101b7 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; @@ -50,6 +51,7 @@ class _SendFeedbackPageState extends State { var _currentLocaleId; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; + int selectedStatusIndex = 5; var event = RobotProvider(); List appoList = []; @@ -165,16 +167,16 @@ class _SendFeedbackPageState extends State { }); }, child: DoctorCard( - onTap: null, - isInOutPatient: appointHistory.isInOutPatient, - name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, - // billNo: _appointmentResult.invoiceNo, - profileUrl: appointHistory.doctorImageURL, - subName: appointHistory.projectName, - isLiveCareAppointment: appointHistory.isLiveCareAppointment, - date: DateUtil.convertStringToDate(appointHistory.appointmentDate), - rating: appointHistory.actualDoctorRate + 0.0, - appointmentTime: appointHistory.startTime.substring(0, 5), + onTap: null, + isInOutPatient: appointHistory.isInOutPatient, + name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, + // billNo: _appointmentResult.invoiceNo, + profileUrl: appointHistory.doctorImageURL, + subName: appointHistory.projectName, + isLiveCareAppointment: appointHistory.isLiveCareAppointment, + date: DateUtil.convertStringToDate(appointHistory.appointmentDate), + rating: appointHistory.actualDoctorRate + 0.0, + appointmentTime: appointHistory.startTime.substring(0, 5), ), ), SizedBox(height: 12), @@ -182,8 +184,9 @@ class _SendFeedbackPageState extends State { Container( margin: EdgeInsets.only(bottom: 10.0), height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, - child: ListView.builder( + child: ListView.separated( itemCount: appoList.length, + separatorBuilder: (ctx, index) => SizedBox(height: 12), itemBuilder: (context, index) => InkWell( onTap: () { setState(() { @@ -309,6 +312,7 @@ class _SendFeedbackPageState extends State { messageController.text = ""; images = []; }); + selectedStatusIndex = 5; setMessageType(MessageType.NON); GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); @@ -429,6 +433,72 @@ class _SendFeedbackPageState extends State { // Show Dialog function void confirmBox(FeedbackViewModel model) { DoctorsListService service = new DoctorsListService(); + + List list = [ + RadioSelectionDialogModel(TranslationBase.of(context).notClassified, 5), + RadioSelectionDialogModel(TranslationBase.of(context).complainAppo, 1), + RadioSelectionDialogModel(TranslationBase.of(context).complainWithoutAppo, 2), + RadioSelectionDialogModel(TranslationBase.of(context).question, 3), + RadioSelectionDialogModel(TranslationBase.of(context).compliment, 4), + RadioSelectionDialogModel(TranslationBase.of(context).suggestion, 6), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: selectedStatusIndex, + onValueSelected: (index) { + selectedStatusIndex = index; + + if (index == 1) { + messageType = MessageType.ComplaintOnAnAppointment; + } else if (index == 2) { + messageType = MessageType.ComplaintWithoutAppointment; + } else if (index == 3) { + messageType = MessageType.Question; + } else if (index == 4) { + messageType = MessageType.Compliment; + } else if (index == 5) { + messageType = MessageType.NON; + } else { + messageType = MessageType.Suggestion; + } + + if (messageType == MessageType.ComplaintOnAnAppointment) { + appoList.clear(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + if (res['AppoimentAllHistoryResultList'].length != 0) { + res['AppoimentAllHistoryResultList'].forEach((v) { + appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + setState(() { + appointHistory = null; + isShowListAppointHistory = true; + }); + } else {} + } else {} + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + // print(err); + // AppToast.showErrorToast(message: err); + // Navigator.of(context).pop(); + }); + } else { + isShowListAppointHistory = false; + } + setMessageType(messageType); + }, + ), + ); + + return; + // todo 'sikander' remove useless code showDialog( context: context, child: FeedbackTypeDialog( @@ -450,8 +520,7 @@ class _SendFeedbackPageState extends State { isShowListAppointHistory = true; }); } else {} - } else { - } + } else {} }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index cebcacdc..120428c4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -388,11 +388,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); } - showDialogs(String message) { - ConfirmDialog dialog = new ConfirmDialog( - context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); - dialog.showAlertDialog(context); - } + // todo 'sikander' remove useless code + // showDialogs(String message) { + // ConfirmDialog dialog = new ConfirmDialog( + // context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); + // dialog.showAlertDialog(context); + // } Future> requestPermissions() async { var permissionResults = [ diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 3fa6ce39..b5535982 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -19,11 +21,12 @@ class MedicalReports extends StatelessWidget { void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, - child: ConfirmDialog( - appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).confirmMsgReport, + onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), ), ); + return; } ProjectViewModel projectViewModel = Provider.of(context); @@ -36,182 +39,100 @@ class MedicalReports extends StatelessWidget { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF7F7F7), - body: ListView.separated( - physics: BouncingScrollPhysics(), - itemCount: model.appointHistoryList.length, - padding: EdgeInsets.all(21), - separatorBuilder: (context, index) => SizedBox(height: 14), - itemBuilder: (context, index) { - AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; - return InkWell( - onTap: () => confirmBox(model.appointHistoryList[index], model), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - //spreadRadius: 5, - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - color: Colors.white), - child: Padding( - padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) - Text( - _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - Text( - DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), - ], - ), - if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - LargeAvatar( - name: _appointmenHistory.doctorName, - url: _appointmenHistory.doctorImageURL, - width: 48, - height: 48, + body: model.appointHistoryList.isEmpty + ? getNoDataWidget(context) + : ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.appointHistoryList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) { + AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; + return InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - SizedBox(width: 11), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) + Text( + _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Text( + DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + ], + ), + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), + Row( mainAxisSize: MainAxisSize.min, children: [ - if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), - if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RatingBar.readOnly( - initialRating: _appointmenHistory.actualDoctorRate.toDouble(), - size: 16.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - Icon(Icons.email, color: Color(0xff2B353E)) - ], + LargeAvatar( + name: _appointmenHistory.doctorName, + url: _appointmenHistory.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), + if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RatingBar.readOnly( + initialRating: _appointmenHistory.actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + Icon(Icons.email, color: Color(0xff2B353E)) + ], + ), + ], + ), ), ], ), - ), - ], - ), - ], - ), - ), - ), - ); - }, - ), - ), - ); - } -} - -class ConfirmDialog extends StatefulWidget { - final Function(AppointmentHistory) onOkSelected; - final AppointmentHistory appointmentHistory; - - ConfirmDialog({this.onOkSelected, this.appointmentHistory}); - - @override - _ConfirmDialogState createState() => _ConfirmDialogState(); -} - -class _ConfirmDialogState extends State { - @override - Widget build(BuildContext context) { - return SimpleDialog( - title: Texts(TranslationBase.of(context).confirm), - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts(TranslationBase.of(context).confirmMsgReport), - SizedBox( - height: 5.0, - ), - Divider( - height: 2.5, - color: Colors.grey[500], - ), - SizedBox( - height: 5, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.pop(context), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel, - color: Colors.red, - ), - ), + ], ), ), ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onOkSelected(widget.appointmentHistory); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - ), - ), - ), - ), - ), - ], - ) - ], - ), - ) - ], + ); + }, + ), + ), ); } -} +} \ No newline at end of file From e564cdc7e503fbbb5af9c83eab68bba64d35d0b9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Oct 2021 14:28:27 +0300 Subject: [PATCH 25/33] Updates & fixes --- lib/config/localized_values.dart | 22 +++-- lib/core/service/client/base_app_client.dart | 4 +- .../new_e_referral_step_three_page.dart | 1 + .../new_e_referral_step_two_page.dart | 92 +++++++++++-------- .../select_search_criteria_dialog.dart | 10 +- .../E-Referral/search_for_referrals_page.dart | 17 ++-- .../MyAppointments/AppointmentDetails.dart | 11 ++- .../widgets/AppointmentActions.dart | 4 +- .../insurance/insurance_approval_screen.dart | 2 +- .../insurance/insurance_update_screen.dart | 2 +- lib/pages/landing/landing_page.dart | 2 +- .../landing/widgets/logged_slider_view.dart | 2 +- .../medical/balance/confirm_payment_page.dart | 14 ++- .../medical/labs/passport_update_page.dart | 2 +- .../blood_suger/AddBloodSugarPage.dart | 2 +- lib/uitl/translations_delegate_base.dart | 10 ++ 16 files changed, 116 insertions(+), 81 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f67c1850..cb531689 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -92,7 +92,7 @@ const Map localizedValues = { 'changePayment': {'en': 'Change Payment Method', 'ar': 'تغيير آلية الدفع'}, 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يلزم اتخاذ أي إجراء'}, 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, - "book-success-confirm-more-24-1-2": {"en": "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."}, + "book-success-confirm-more-24-1-2": {"en": "The online payment process will be available 24 hours before the appointment.", "ar": "عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."}, 'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'}, 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي طابور الانتظار'}, 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور بشكل آلي في المستشفى'}, @@ -258,7 +258,7 @@ const Map localizedValues = { "requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}, "register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"}, "remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"}, - "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, + "MyMedicalFile": {"en": "My Medical File", 'ar': 'الملف الطبي الالكتروني'}, "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, @@ -331,7 +331,7 @@ const Map localizedValues = { "MyDoctorSubtitle": {"en": "List", "ar": "قمت بزيارتهم"}, "Eye": {"en": "Eye", "ar": "قياسات"}, "EyeSubtitle": {"en": "Measurement", "ar": "النظر"}, - "Insurance": {"en": "Insurance", "ar": "بطاقة"}, + "Insurance": {"en": "Insurance", "ar": "بطاقات"}, "InsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, "UpdateInsurance": {"en": "Update Insurance", "ar": "تحديث التأمين"}, "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, @@ -399,7 +399,7 @@ const Map localizedValues = { "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, "FileNumber": {"en": "File Number", "ar": "رقم الملف"}, - "Amount": {"en": "Amount *", "ar": "المبلغ *"}, + "Amount": {"en": "Amount *", "ar": "الكمية *"}, "DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"}, "Notes": {"en": "Notes", "ar": "ملاحظات"}, "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, @@ -511,9 +511,9 @@ const Map localizedValues = { "medicalFile": {"en": "Medical File", "ar": "ملف طبي"}, "verified": {"en": "Verified", "ar": "تم التحقق"}, "checkup": {"en": "Checkup", "ar": "فحص"}, - "hhcHome": {"en": "HHC Home", "ar": "الصفحة الرئيسية HHC"}, + "hhcHome": {"en": "Home", "ar": "الرعاية"}, "refferal": {"en": "E-Refferal", "ar": "الإحالة الإلكترونية"}, - "healthCare": {"en": "Health Care", "ar": "الرعاية الصحية"}, + "healthCare": {"en": "Health Care", "ar": "الصحية المزلية"}, "emergency": {"en": "Emergency", "ar": "طارئ"}, "cantSeeProfile": {"en": "Can’t see your medical File?", "ar": "لا تستطيع رؤية ملفك الطبي؟"}, "loginRegisterNow": {"en": "Login or Register Now", "ar": "تسجيل الدخول أو التسجيل الآن"}, @@ -521,7 +521,7 @@ const Map localizedValues = { "ecommerceSolution": {"en": "Ecommerce Solution", "ar": "حل التجارة الإلكترونية"}, "services2": {"en": "Services", "ar": "خدمات"}, "comprehensive": {"en": "Comprehensive", "ar": "شامل"}, - "onlineConsulting": {"en": "Online Consulting", "ar": "استشارات عبر الإنترنت"}, + "onlineConsulting": {"en": "Online Consulting", "ar": "استشارات فورية"}, "pendingOrder": {"en": " PENDING", "ar": " معلقة"}, "deliveredOrder": {"en": " DELIVERED", "ar": "تم التوصيل"}, "processingOrder": {"en": " PROCESSING", "ar": "قيد التنفيذ"}, @@ -1238,7 +1238,7 @@ const Map localizedValues = { "undo": {"en": "Undo", "ar": "تراجع"}, "drinking": {"en": "Drinkning", "ar": "الشرب"}, "remaining": {"en": "Remaining", "ar": "المتبقي"}, - "addCustomAmount": {"en": "Add Custom Amount", "ar": "إضافة مبلغ مخصص"}, + "addCustomAmount": {"en": "Add Custom Amount", "ar": "إضافة كمية محددة"}, "left": {"en": "Left", "ar": "المتبقي"}, "taken": {"en": "Taken", "ar": " مأخوذ"}, "ml": {"en": "ML", "ar": "مل"}, @@ -1300,7 +1300,7 @@ const Map localizedValues = { "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, "app-update": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"}, "covid-alert": {"en": "Alert", "ar": "تنبيه"}, - "enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم التعريف"}, + "enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم الهوية"}, "identificationNumber": {"en": "Identification Number", "ar": "رقم الهوية"}, "complaintNumber": {"en": "Complaint Number", "ar": "رقم الشكوى"}, "accountActivationDesc": { @@ -1513,4 +1513,8 @@ const Map localizedValues = { "modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" }, "prefferedMode": { "en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه" }, "permissionsBellow": { "en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه" }, + "appointmentReminder": { "en": "Would you like to set a reminder for this appointment in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا الموعد في التقويم؟" }, + "cancelAppointment": { "en": "Cancel Appt.", "ar": "الغاء الموعد" }, + "updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"}, + "patientAge": {"en": "y", "ar": "سنة"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 2365d2d1..50fbcdc7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -119,9 +119,11 @@ class BaseAppClient { // // if(body.containsKey("patientOutSa")) // body.remove("PatientOutSA"); - + // // body['PatientID'] = 1018977; // body['TokenID'] = "@dm!n"; + // body['IdentificationNo'] = "1009199553"; + // body['MobileNo'] = "966545156035"; print("URL : $url"); final jsonBody = json.encode(body); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 7a1a954b..b7fa4532 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -485,6 +485,7 @@ class _NewEReferralStepThreePageState extends State { ); } + String getRelationName() { if (_selectedCity != null) return _selectedCity.description; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 734c5f28..06a6b4fb 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -98,33 +99,34 @@ class _NewEReferralStepTowPageState extends State { SizedBox( height: 12, ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getCountryName()), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), + // InkWell( + // onTap: () => confirmSelectCountryTypeDialog(), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getCountryName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), SizedBox( height: 12, ), - MobileNumberTextFiled( - controller: _mobileTextController, - code: _selectedCountry == null - ? "11" - : _selectedCountry["code"], - ), + // MobileNumberTextFiled( + // controller: _mobileTextController, + // code: _selectedCountry == null + // ? "11" + // : _selectedCountry["code"], + // ), + PhoneNumberSelectorWidget(onNumberChange: (value) => {_mobileTextController.text = value, validateForm()}, onCountryChange: (value) => _selectedCountry = value), SizedBox( height: 12, ), @@ -208,6 +210,18 @@ class _NewEReferralStepTowPageState extends State { ); } + void validateForm() { + // if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + // setState(() { + // isButtonDisabled = false; + // }); + // } else { + // setState(() { + // isButtonDisabled = true; + // }); + // } + } + void confirmSelectCountryTypeDialog() { showDialog( context: context, @@ -238,7 +252,7 @@ class _NewEReferralStepTowPageState extends State { } class MobileNumberTextFiled extends StatelessWidget { - const MobileNumberTextFiled({ + MobileNumberTextFiled({ Key key, this.controller, this.code @@ -246,7 +260,7 @@ class MobileNumberTextFiled extends StatelessWidget { final TextEditingController controller; - final String code; + String code; @override Widget build(BuildContext context) { @@ -267,19 +281,21 @@ class MobileNumberTextFiled extends StatelessWidget { code.toString(), overflow: TextOverflow.clip, )), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(5), - child: TextField( - controller: controller, - keyboardType: TextInputType.phone, - decoration: InputDecoration( - border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), - ), - ), - ) + // Expanded( + // flex: 4, + // child: Container( + // margin: EdgeInsets.all(5), + // child: TextField( + // controller: controller, + // keyboardType: TextInputType.phone, + // decoration: InputDecoration( + // border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), + // ), + // ), + // ) + // PhoneNumberSelectorWidget(onNumberChange: (value) => {controller.text = value, validateForm()}, onCountryChange: (value) => code = value), ]), ); } + } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart index f4c8d989..e4beed9e 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -7,14 +8,15 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class SelectSearchCriteriaDialog extends StatefulWidget { List searchCriteria = [ - SearchCriteriaModel(name: "Identification Number",nameAr:"رقم المحول",value: 1), - SearchCriteriaModel(name: "Referral Number",nameAr:"رقم المحول",value: 2), + SearchCriteriaModel(name: "Identification Number",nameAr:"رقم الهوية",value: 1), + SearchCriteriaModel(name: "Referral Number",nameAr:"رقم الإحالة",value: 2), ]; final Function(SearchCriteriaModel) onValueSelected; SearchCriteriaModel selectedCriteria; + ProjectViewModel projectViewModel; SelectSearchCriteriaDialog( - {Key key, this.onValueSelected, this.selectedCriteria}); + {Key key, this.onValueSelected, this.selectedCriteria, this.projectViewModel}); @override _SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState(); @@ -54,7 +56,7 @@ class _SelectSearchCriteriaDialogState extends State }); }, child: ListTile( - title: Text(widget.searchCriteria[index].name), + title: Text(widget.projectViewModel.isArabic ? widget.searchCriteria[index].nameAr : widget.searchCriteria[index].name), leading: Radio( value: widget.searchCriteria[index], groupValue: widget.selectedCriteria, diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 356e8eb1..2839699b 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -39,9 +39,9 @@ class _SearchForReferralsPageState extends State { TextEditingController _mobileTextController = TextEditingController(); bool _isSubmitted = false; - dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; + dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; - SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم المحول", value: 1); + SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم الهوية", value: 1); @override Widget build(BuildContext context) { @@ -81,7 +81,7 @@ class _SearchForReferralsPageState extends State { height: 10, ), InkWell( - onTap: () => selectSearchCriteriaDialog(), + onTap: () => selectSearchCriteriaDialog(projectViewModel), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -89,7 +89,7 @@ class _SearchForReferralsPageState extends State { decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], + children: [Texts(getSearchCriteriaName(projectViewModel)), Icon(Icons.arrow_drop_down)], ), ), ), @@ -97,7 +97,7 @@ class _SearchForReferralsPageState extends State { height: 12, ), NewTextFields( - hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", + hintText: selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, controller: _searchTextController, onChanged: (_) { setState(() {}); @@ -244,11 +244,12 @@ class _SearchForReferralsPageState extends State { return "Country"; } - void selectSearchCriteriaDialog() { + void selectSearchCriteriaDialog(ProjectViewModel projectViewModel) { showDialog( context: context, child: SelectSearchCriteriaDialog( selectedCriteria: selectedCriteria, + projectViewModel: projectViewModel, onValueSelected: (value) { setState(() { selectedCriteria = value; @@ -258,7 +259,7 @@ class _SearchForReferralsPageState extends State { ); } - String getSearchCriteriaName() { - return selectedCriteria.name; + String getSearchCriteriaName(ProjectViewModel projectViewModel) { + return projectViewModel.isArabic ? selectedCriteria.nameAr : selectedCriteria.name; } } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 57e2ea3b..06710183 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailab import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -187,7 +188,7 @@ class _AppointmentDetailsState extends State with SingleTick list.add( Expanded( child: DefaultButton( - TranslationBase.of(context).cancel, + TranslationBase.of(context).cancelAppointment, () { ConfirmDialog dialog = new ConfirmDialog( context: context, @@ -198,8 +199,8 @@ class _AppointmentDetailsState extends State with SingleTick cancelFunction: () => {}); dialog.showAlertDialog(context); }, - color: Color(0xffEAEAEA), - textColor: Color(0xff000000), + color: CustomColors.accentColor, + textColor: CustomColors.white, ), ), ); @@ -219,7 +220,7 @@ class _AppointmentDetailsState extends State with SingleTick list.add( Expanded( child: DefaultButton( - TranslationBase.of(context).cancel, + TranslationBase.of(context).cancelAppointment, () { ConfirmDialog dialog = new ConfirmDialog( context: context, @@ -230,7 +231,7 @@ class _AppointmentDetailsState extends State with SingleTick cancelFunction: () => {}); dialog.showAlertDialog(context); }, - // color: Color(0xffEAEAEA), + color: CustomColors.accentColor, // textColor: Color(0xff000000), ), ), diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index ee94a616..224f3db8 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -381,12 +381,12 @@ class _AppointmentActionsState extends State { print(finalRadiology.reportData); navigateToRadiologyDetails(finalRadiology); } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + AppToast.showErrorToast(message: TranslationBase.of(context).noResultFound); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: TranslationBase.of(context).noResultFound); }); } diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index a88d89ab..51422bcd 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -43,7 +43,7 @@ class _InsuranceApprovalState extends State { showNewAppBar: true, baseViewModel: model, showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).insuranceApproval, + appBarTitle: TranslationBase.of(context).insuranceApprovalSubtitle, description: TranslationBase.of(context).infoApprovals, infoList: TranslationBase.of(context).infoApprovalPoints, imagesInfo: imagesInfo, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 24b5465f..5b68687f 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -36,7 +36,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - appBarTitle: TranslationBase.of(context).insurCards, + appBarTitle: TranslationBase.of(context).updateInsurCards, description: TranslationBase.of(context).infoInsurCards, infoList: TranslationBase.of(context).infoPrescriptionsPoints, imagesInfo: imagesInfo, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index cebcacdc..02561e1d 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -404,7 +404,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { // Permission.notification, // Permission.accessMediaLocation, // Permission.calendar, - Permission.activityRecognition + // Permission.activityRecognition ].request(); // var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index a239e789..a0665e85 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -123,7 +123,7 @@ class LoggedSliderView extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 20, right: 20), child: Text( - '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + "y"}', + '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}', style: TextStyle( color: Colors.white, fontSize: 12, diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index bc92bc08..e1a0b843 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; 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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -190,15 +191,12 @@ class _ConfirmPaymentPageState extends State { bottomSheet: Container( color: Colors.white, child: Container( - height: MediaQuery.of(context).size.width * 0.18, + // height: MediaQuery.of(context).size.width * 0.18, width: double.infinity, - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: CustomColors.accentColor, - label: TranslationBase.of(context).confirm.toUpperCase(), - disabled: model.state == ViewState.Busy, - onTap: () { + padding: EdgeInsets.all(20), + child: DefaultButton( + TranslationBase.of(context).confirm.toUpperCase(), + () { GifLoaderDialogUtils.showMyDialog(context); model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index 51efda3a..f9a665d1 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -90,7 +90,7 @@ class _PassportUpdatePageState extends State { Row( children: [ Text( - TranslationBase.of(context).fileNo + ":", + TranslationBase.of(context).identificationNumber + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 10, diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 0095fb94..4efc7ba5 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -56,7 +56,7 @@ class _AddBloodSugarPageState extends State { final List measureTimeArList = [ "قبل الإفطار", "بعد الإفطار", - "بعد الغداء", + "قبل الغداء", "بعد الغداء", "قبل العشاء", "بعد العشاء", diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index edc2e2e0..ba8dba86 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2385,6 +2385,16 @@ class TranslationBase { String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode]; String get enterComplainNumber => localizedValues["enterComplainNumber"][locale.languageCode]; + + String get cancelAppointment => localizedValues["cancelAppointment"][locale.languageCode]; + + String get updateInsurCards => localizedValues["updateInsurCards"][locale.languageCode]; + + String get patientAge => localizedValues["patientAge"][locale.languageCode]; + + + + } class TranslationBaseDelegate extends LocalizationsDelegate { From ecb6315f9ceba0d296e0c7fe68f2149641097a83 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 17 Oct 2021 16:27:35 +0300 Subject: [PATCH 26/33] blood pressure, blood sugar, weight, order log & send feedback dialog changes and improvements (cont). --- .../orders_log_details_page.dart | 24 + .../orders_log_details_page.dart | 247 ++++---- lib/pages/feedback/send_feedback_page.dart | 540 +++++++++--------- .../my_trackers/Weight/AddWeightPage.dart | 170 +++--- .../blood_pressure/AddBloodPressurePage.dart | 136 +++-- .../blood_pressure/BloodPressureHomePage.dart | 192 +++---- .../blood_suger/AddBloodSugarPage.dart | 3 +- lib/widgets/otp/sms-popup.dart | 52 +- 8 files changed, 725 insertions(+), 639 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index 4de0e61d..ac0a8599 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -28,6 +29,29 @@ class OrdersLogDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).cancelOrderMsg, + onTap: () { + 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); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + GifLoaderDialogUtils.hideDialog(context); + } else { + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); + await model.getCmcAllPresOrders(); + GifLoaderDialogUtils.hideDialog(context); + } + }); + }, + )); + return; + + // todo 'sikander' remove useless code showDialog( context: context, child: ConfirmCancelOrderDialog( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index f7b103d5..948ee8d6 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -8,8 +8,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.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/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -26,6 +25,28 @@ class OrdersLogDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).cancelOrderMsg, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); + model.setState(ViewState.Busy); + await model.updateHHCPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); + await model.getHHCAllPresOrders(); + // await model.getHHCAllServices(); + } + }, + ), + ); + return; + + // todo 'sikander' remove useless code + showDialog( context: context, child: ConfirmCancelOrderDialog( @@ -49,128 +70,130 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - body: model.hhcAllPresOrders.length > 0 ? ListView.separated( - padding: EdgeInsets.all(21), - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index]; + body: model.hhcAllPresOrders.length > 0 + ? ListView.separated( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index]; - int status = order.status; - String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; - 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) { - //cancel // Rejected - _color = Color(0xffD02127); - } - return Container( - decoration: BoxDecoration( - color: _color, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - ), - child: Container( - // decoration: containerColorRadiusLeft(Colors.white, 12), - margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), - padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.only( - bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), - topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + int status = order.status; + String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; + 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) { + //cancel // Rejected + _color = Color(0xffD02127); + } + return Container( + decoration: BoxDecoration( + color: _color, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], ), - ), - // clipBehavior: Clip.antiAlias, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - _statusDisp, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), - ), - SizedBox(height: 6), - Text( - '${TranslationBase.of(context).requestID}: ${order.iD}', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - Row( + child: Container( + // decoration: containerColorRadiusLeft(Colors.white, 12), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), + padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.only( + bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + ), + ), + // clipBehavior: Clip.antiAlias, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, 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), + _statusDisp, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), ), - Expanded( - child: Text( - !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), - ), + SizedBox(height: 6), + Text( + '${TranslationBase.of(context).requestID}: ${order.iD}', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), + 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(), + 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(order.createdOn)), - 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) - InkWell( - onTap: () { - showConfirmMessage(model, order); - }, - 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), - ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), + 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) + InkWell( + onTap: () { + showConfirmMessage(model, order); + }, + 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), + ), + ), + ), + ], + ), ], ), - ], - ), - ), - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 12), - itemCount: model.hhcAllPresOrders.length) : getNoDataWidget(context), + ), + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 12), + itemCount: model.hhcAllPresOrders.length) + : getNoDataWidget(context), ); } } diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 731101b7..dc1b47f7 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -499,41 +499,41 @@ class _SendFeedbackPageState extends State { return; // todo 'sikander' remove useless code - showDialog( - context: context, - child: FeedbackTypeDialog( - messageTypeDialog: messageType, - onValueSelected: (MessageType value) { - if (value == MessageType.ComplaintOnAnAppointment) { - appoList.clear(); - GifLoaderDialogUtils.showMyDialog(context); - service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - if (res['MessageStatus'] == 1) { - if (res['AppoimentAllHistoryResultList'].length != 0) { - res['AppoimentAllHistoryResultList'].forEach((v) { - appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); - }); - setState(() { - appointHistory = null; - isShowListAppointHistory = true; - }); - } else {} - } else {} - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - // print(err); - // AppToast.showErrorToast(message: err); - // Navigator.of(context).pop(); - }); - } else { - isShowListAppointHistory = false; - } - setMessageType(value); - }, - )); + // showDialog( + // context: context, + // child: FeedbackTypeDialog( + // messageTypeDialog: messageType, + // onValueSelected: (MessageType value) { + // if (value == MessageType.ComplaintOnAnAppointment) { + // appoList.clear(); + // GifLoaderDialogUtils.showMyDialog(context); + // service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { + // GifLoaderDialogUtils.hideDialog(context); + // setState(() { + // if (res['MessageStatus'] == 1) { + // if (res['AppoimentAllHistoryResultList'].length != 0) { + // res['AppoimentAllHistoryResultList'].forEach((v) { + // appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + // }); + // setState(() { + // appointHistory = null; + // isShowListAppointHistory = true; + // }); + // } else {} + // } else {} + // }); + // }).catchError((err) { + // GifLoaderDialogUtils.hideDialog(context); + // // print(err); + // // AppToast.showErrorToast(message: err); + // // Navigator.of(context).pop(); + // }); + // } else { + // isShowListAppointHistory = false; + // } + // setMessageType(value); + // }, + // )); } openSpeechReco() async { @@ -587,238 +587,238 @@ class _SendFeedbackPageState extends State { if (!mounted) return; } } - -class FeedbackTypeDialog extends StatefulWidget { - final Function(MessageType) onValueSelected; - final MessageType messageTypeDialog; - - const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); - - @override - State createState() => new FeedbackTypeDialogState(); -} - -class FeedbackTypeDialogState extends State { - MessageType messageTypeDialog = MessageType.NON; - - setMessageDialogType(MessageType messageType) { - setState(() { - messageTypeDialog = messageType; - }); - } - - @override - void initState() { - messageTypeDialog = widget.messageTypeDialog; - - super.initState(); - } - - Widget build(BuildContext context) { - return BaseView( - builder: (_, model, widge) => SimpleDialog( - title: Text( - TranslationBase.of(context).messageType, - textAlign: TextAlign.center, - ), - children: [ - Container( - // padding: const EdgeInsets.all(10.0), - child: Column( - children: [ - Divider( - height: 2.5, - color: Colors.grey[500], - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.NON), - child: ListTile( - title: Texts(TranslationBase.of(context).notClassified), - leading: Radio( - value: MessageType.NON, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), - child: ListTile( - title: Texts(TranslationBase.of(context).complainAppo), - leading: Radio( - value: MessageType.ComplaintOnAnAppointment, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), - child: ListTile( - title: Texts(TranslationBase.of(context).complainWithoutAppo), - leading: Radio( - value: MessageType.ComplaintWithoutAppointment, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.Question), - child: ListTile( - title: Texts(TranslationBase.of(context).question), - leading: Radio( - value: MessageType.Question, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.Compliment), - child: ListTile( - title: Texts(TranslationBase.of(context).compliment), - leading: Radio( - value: MessageType.Compliment, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.Suggestion), - child: ListTile( - title: Texts(TranslationBase.of(context).suggestion), - leading: Radio( - value: MessageType.Suggestion, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Divider( - height: 2.5, - color: Colors.grey[500], - ), - SizedBox( - height: 5, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel, - color: CustomColors.accentColor, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(messageTypeDialog); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), - )), - ], - ) - ], - ), - ), - ], - ), - ); - } -} +// todo 'sikander' remove useless code +// class FeedbackTypeDialog extends StatefulWidget { +// final Function(MessageType) onValueSelected; +// final MessageType messageTypeDialog; +// +// const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); +// +// @override +// State createState() => new FeedbackTypeDialogState(); +// } +// +// class FeedbackTypeDialogState extends State { +// MessageType messageTypeDialog = MessageType.NON; +// +// setMessageDialogType(MessageType messageType) { +// setState(() { +// messageTypeDialog = messageType; +// }); +// } +// +// @override +// void initState() { +// messageTypeDialog = widget.messageTypeDialog; +// +// super.initState(); +// } +// +// Widget build(BuildContext context) { +// return BaseView( +// builder: (_, model, widge) => SimpleDialog( +// title: Text( +// TranslationBase.of(context).messageType, +// textAlign: TextAlign.center, +// ), +// children: [ +// Container( +// // padding: const EdgeInsets.all(10.0), +// child: Column( +// children: [ +// Divider( +// height: 2.5, +// color: Colors.grey[500], +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.NON), +// child: ListTile( +// title: Texts(TranslationBase.of(context).notClassified), +// leading: Radio( +// value: MessageType.NON, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), +// child: ListTile( +// title: Texts(TranslationBase.of(context).complainAppo), +// leading: Radio( +// value: MessageType.ComplaintOnAnAppointment, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), +// child: ListTile( +// title: Texts(TranslationBase.of(context).complainWithoutAppo), +// leading: Radio( +// value: MessageType.ComplaintWithoutAppointment, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.Question), +// child: ListTile( +// title: Texts(TranslationBase.of(context).question), +// leading: Radio( +// value: MessageType.Question, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.Compliment), +// child: ListTile( +// title: Texts(TranslationBase.of(context).compliment), +// leading: Radio( +// value: MessageType.Compliment, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.Suggestion), +// child: ListTile( +// title: Texts(TranslationBase.of(context).suggestion), +// leading: Radio( +// value: MessageType.Suggestion, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Divider( +// height: 2.5, +// color: Colors.grey[500], +// ), +// SizedBox( +// height: 5, +// ), +// Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.pop(context); +// }, +// child: Padding( +// padding: EdgeInsets.all(8.0), +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).cancel, +// color: CustomColors.accentColor, +// ), +// ), +// ), +// ), +// ), +// ), +// Container( +// width: 1, +// height: 30, +// color: Colors.grey[500], +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// widget.onValueSelected(messageTypeDialog); +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Texts( +// TranslationBase.of(context).ok, +// fontWeight: FontWeight.w400, +// )), +// ), +// )), +// ], +// ) +// ], +// ), +// ), +// ], +// ), +// ); +// } +// } diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart index 5380896e..7c96dc3e 100644 --- a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -8,8 +8,10 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -35,12 +37,15 @@ class _AddWeightPageState extends State { TextEditingController _weightValueController = TextEditingController(); DateTime dayWeightDate = DateTime.now(); DateTime timeWeightDate = DateTime.now(); - int weightUnit = 1; + int weightUnit = 0; final List measureUnitEnList = [ - 'Kg', 'Pound', + 'Kg', + ]; + final List measureUnitArList = [ + "باوند", + "كيلو جرام", ]; - final List measureUnitArList = ["كيلو جرام", "باوند"]; String measureTimeSelectedType; bool isButtonDisabled = true; @@ -52,9 +57,6 @@ class _AddWeightPageState extends State { timeWeightDate = widget.dayWeightDate; measureTimeSelectedType = widget.measureTimeSelectedType; weightUnit = widget.weightUnit; - // if (measureUnitEnList.contains(widget.measureTimeSelectedType)) - // weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType); - // else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType); _weightValueController.text = widget.weightValue; validateForm(); } @@ -65,19 +67,17 @@ class _AddWeightPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - isShowAppBar: true, - appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - showNewAppBar: true, - showNewAppBarTitle: true, - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( + isShowAppBar: true, + appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, + showNewAppBar: true, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), children: [ - SizedBox( - height: 15, - ), NewTextFields( hintText: TranslationBase.of(context).weightAdd, controller: _weightValueController, @@ -86,12 +86,27 @@ class _AddWeightPageState extends State { fontWeight: FontWeight.normal, fontSize: 14, ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureUnitArList : measureUnitEnList); + List list = [ + RadioSelectionDialogModel(projectViewModel.isArabic ? measureUnitArList[0] : measureUnitEnList[0], 0), + RadioSelectionDialogModel(projectViewModel.isArabic ? measureUnitArList[1] : measureUnitEnList[1], 1), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: weightUnit, + onValueSelected: (index) { + weightUnit = index; + measureTimeSelectedType = list[index].title; + setState(() {}); + validateForm(); + }, + ), + ); }, child: Container( padding: EdgeInsets.all(12), @@ -110,9 +125,7 @@ class _AddWeightPageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showDatePicker( @@ -143,9 +156,7 @@ class _AddWeightPageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showTimePicker( @@ -185,6 +196,28 @@ class _AddWeightPageState extends State { color: Colors.red[900], ), onTap: () { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).removeMeasure, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.ErrorLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + }, + ), + ); + return; + + // todo 'sikander' remove useless code ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: TranslationBase.of(context).removeMeasure, @@ -209,55 +242,58 @@ class _AddWeightPageState extends State { dialog.showAlertDialog(context); }) ], - )) + ), + ) : Container() ], ), ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Padding( - padding: const EdgeInsets.all(20.0), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).save.toUpperCase(), - isButtonDisabled ? null : () async { - if (_weightValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - if (widget.isUpdate) { - widget.model - .updateWeightResult( + isButtonDisabled + ? null + : () async { + if (_weightValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + if (widget.isUpdate) { + widget.model + .updateWeightResult( + weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } else + widget.model + .addWeightResult( weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', weightMeasured: _weightValueController.text.toString(), - weightUnit: weightUnit + 1, - lineItemNo: widget.lineItemNo) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.Error) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - }); - } else - widget.model - .addWeightResult( - weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', - weightMeasured: _weightValueController.text.toString(), - weightUnit: weightUnit, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.Error) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - }); - } - }, + weightUnit: weightUnit, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } + }, disabledColor: Colors.grey, ), - ), - )); + ) + ], + ), + ); } String getDate() { diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 44a28209..77bb45b7 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -40,13 +41,10 @@ class _AddBloodPressurePageState extends State { TextEditingController _bloodDiastolicValueController = TextEditingController(); DateTime bloodSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now(); - int measuredArm = 1; + int measuredArm = 0; bool isButtonDisabled = true; - final List measureTimeEnList = ['Right Arm', 'Left Arm']; - final List measureTimeArList = [ - 'الذراع الأيمن', - 'الذراع الأيسر', - ]; + final List measureTimeEnList = ['Left Arm', 'Right Arm']; + final List measureTimeArList = ['الذراع الأيسر', 'الذراع الأيمن']; String measureTimeSelectedType = 'Left Arm'; @override @@ -56,7 +54,9 @@ class _AddBloodPressurePageState extends State { bloodSugarDate = widget.bloodSugarDate; bloodSugarDate = widget.bloodSugarDate; measureTimeSelectedType = widget.measureTimeSelectedType; - measuredArm = widget.measuredArm - 1; + measuredArm = widget.measuredArm; + if (measuredArm > 1) measuredArm = measuredArm - 1; + _bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue; validateForm(); @@ -68,19 +68,17 @@ class _AddBloodPressurePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - isShowAppBar: true, - appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - showNewAppBar: true, - showNewAppBarTitle: true, - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( + isShowAppBar: true, + appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, + showNewAppBar: true, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), children: [ - SizedBox( - height: 15, - ), NewTextFields( hintText: TranslationBase.of(context).systolicAdd, controller: _bloodSystolicValueController, @@ -90,9 +88,7 @@ class _AddBloodPressurePageState extends State { fontWeight: FontWeight.normal, fontSize: 14, ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), NewTextFields( hintText: TranslationBase.of(context).diastolicAdd, controller: _bloodDiastolicValueController, @@ -102,11 +98,29 @@ class _AddBloodPressurePageState extends State { fontWeight: FontWeight.normal, fontSize: 14, ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { + List list = [ + RadioSelectionDialogModel(projectViewModel.isArabic ? measureTimeArList[0] : measureTimeEnList[0], 0), + RadioSelectionDialogModel(projectViewModel.isArabic ? measureTimeArList[1] : measureTimeEnList[1], 1), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: measuredArm, + onValueSelected: (index) { + measuredArm = index; + measureTimeSelectedType = list[index].title; + setState(() {}); + validateForm(); + }, + ), + ); + return; + confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); }, child: Container( @@ -126,9 +140,7 @@ class _AddBloodPressurePageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { @@ -153,9 +165,7 @@ class _AddBloodPressurePageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { @@ -220,41 +230,43 @@ class _AddBloodPressurePageState extends State { ], ), ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Padding( - padding: const EdgeInsets.all(20.0), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).save, - isButtonDisabled ? null : () async { - if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - widget.model - .addORUpdateDiabtecResult( - isUpdate: widget.isUpdate, - bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: (measuredArm + 1), - lineItemNo: widget.lineItemNo) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.BusyLocal) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - ; - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: widget.model.error); - }); - } - }, + isButtonDisabled + ? null + : () async { + if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + widget.model + .addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: (measuredArm), + lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + ; + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + } + }, disabledColor: Colors.grey, ), - ), - )); + ) + ], + ), + ); } String getDate() { diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index a99b75ea..d0a68588 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -44,113 +44,101 @@ class _BloodPressureHomePageState extends State with Sing ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getBloodPressure(), - builder: (_, model, w) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase - .of(context) - .bloodPressure, - showNewAppBar: true, - showNewAppBarTitle: true, - baseViewModel: model, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: TabBarWidget( - tabController: _tabController, - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - BloodPressureWeeklyPage( - model: model, - ), - BloodPressureMonthlyPage( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).bloodPressure, + showNewAppBar: true, + showNewAppBarTitle: true, + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: TabBarWidget( + tabController: _tabController, + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodPressureWeeklyPage( + model: model, + ), + BloodPressureMonthlyPage( + model: model, + ), + BloodPressureYearPage( + model: model, + ) + ], + ), + ) + ], + ), + floatingActionButton: Stack(children: [ + Positioned( + bottom: 60, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddBloodPressurePage( model: model, + ))).then((value) { + model.getBloodPressure(); + }); + }, + child: Container( + width: 50, + height: 50, + decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), - BloodPressureYearPage( - model: model, - ) - ], - ), - ) - ], - ), - floatingActionButton: Stack(children: [ - Positioned( - bottom: 60, - right: projectViewModel.isArabic ? MediaQuery - .of(context) - .size - .width * .85 : 0, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddBloodPressurePage( - model: model, - ))).then((value) { - model.getBloodPressure(); + )), + )) + ]), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).sendEmail, + () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async { + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).emailSentSuccessfully, + ); + } + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: model.error); }); }, - child: Container( - width: 50, - height: 50, - decoration: BoxDecoration(shape: BoxShape.circle, color: Theme - .of(context) - .primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), - )), - )) - ]), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Padding( - padding: const EdgeInsets.all(12.0), - child: DefaultButton( - TranslationBase - .of(context) - .sendEmail, - () { - showDialog( - context: context, - child: ConfirmSendEmailDialog( - email: model.user.emailAddress, - onTapSendEmail: () async { - GifLoaderDialogUtils.showMyDialog(context); - model.sendReportByEmail().then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - AppToast.showErrorToast(message: model.error); - } else { - AppToast.showSuccessToast( - message: TranslationBase - .of(context) - .emailSentSuccessfully, - ); - } - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: model.error); - }); - }, - ), - ); - }, - // label: TranslationBase.of(context).sendEmail, - // backgroundColor: Colors.red[900], - ), - ), + ), + ); + }, + // label: TranslationBase.of(context).sendEmail, + // backgroundColor: Colors.red[900], ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 0095fb94..b84afc75 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -26,7 +26,8 @@ class AddBloodSugarPage extends StatefulWidget { final String measuredSelectedType; final BloodSugarViewMode bloodSugarViewMode; - AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType}) + AddBloodSugarPage( + {Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType}) : super(key: key); @override diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index be545407..12fb9d3e 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -225,31 +225,33 @@ class SMSOTP { }); } - static void showLoadingDialog(BuildContext context, bool _loading) async { - _context = context; - //setSignature(); - if (_loading == false) { - Navigator.of(context).pop(); - return; - } - _loading = true; - await showDialog( - context: _context, - barrierDismissible: false, - builder: (BuildContext context) { - return SimpleDialog( - elevation: 0.0, - backgroundColor: Colors.transparent, - children: [ - Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Colors.black), - ), - ) - ], - ); - }); - } + + // todo 'sikander' remove useless code + // static void showLoadingDialog(BuildContext context, bool _loading) async { + // _context = context; + // //setSignature(); + // if (_loading == false) { + // Navigator.of(context).pop(); + // return; + // } + // _loading = true; + // await showDialog( + // context: _context, + // barrierDismissible: false, + // builder: (BuildContext context) { + // return SimpleDialog( + // elevation: 0.0, + // backgroundColor: Colors.transparent, + // children: [ + // Center( + // child: CircularProgressIndicator( + // valueColor: AlwaysStoppedAnimation(Colors.black), + // ), + // ) + // ], + // ); + // }); + // } static void hideSMSBox(context) { Navigator.pop(context); From e1b79ef5c196d1f873b616d8e1396e08d67b1256 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 17 Oct 2021 17:08:20 +0300 Subject: [PATCH 27/33] E-Refreal design --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 17 +- .../new_e_referral_index_page.dart | 172 ++++-- .../new_e_referral_step_one_page.dart | 320 +++++++---- .../new_e_referral_step_three_page.dart | 532 +++++++++--------- .../new_e_referral_step_two_page.dart | 356 +++++++----- .../dialogs/select_city_dialog.dart | 178 +++--- .../E-Referral/e_referral_page.dart | 1 + .../E-Referral/search_for_referrals_page.dart | 209 +++++-- lib/theme/colors.dart | 1 + lib/uitl/translations_delegate_base.dart | 6 + lib/uitl/utils.dart | 3 + 12 files changed, 1100 insertions(+), 699 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 18abad39..acb8d80a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// 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/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f67c1850..7e3ac75e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -606,7 +606,6 @@ const Map localizedValues = { "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, - "select": {"en": "Select", "ar": "يختار"}, "i-am": {"en": "I am", "ar": "أنا"}, "years-old": {"en": "years old", "ar": "سنة"}, @@ -1508,9 +1507,15 @@ const Map localizedValues = { "enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"}, "enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"}, "please_select_from_below_options": {"en": "Please select from below options:", "ar": "الرجاء التحديد من الخيارات أدناه:"}, - "selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" }, - "recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" }, - "modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" }, - "prefferedMode": { "en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه" }, - "permissionsBellow": { "en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه" }, + "selectLanguage": {"en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة"}, + "recAlert": {"en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟"}, + "modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"}, + "prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"}, + "permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"}, + + "RequesterInfo": {"en": "Requester Info", "ar": "معلومات مقدم الطلب"}, + "PatientInfo": {"en": "Patient Info", "ar": "معلومات المريض"}, + "OtherInfo": {"en": "Other Info", "ar": "معلومات اخرى"}, + "inPrgress": { "en": "In Progress", "ar": "في تقدم" }, + "locked": { "en": "Locked", "ar": "مقفل" }, }; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart index 45d34e24..5d1d5210 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -1,5 +1,8 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; import 'new_e_referral_step_three_page.dart'; @@ -9,18 +12,15 @@ class StartIndexForNewEReferral extends StatefulWidget { StartIndexForNewEReferral(); @override - _StartIndexForNewEReferralState createState() => - _StartIndexForNewEReferralState(); + _StartIndexForNewEReferralState createState() => _StartIndexForNewEReferralState(); } -class _StartIndexForNewEReferralState extends State - with TickerProviderStateMixin { +class _StartIndexForNewEReferralState extends State with TickerProviderStateMixin { PageController _controller; - int _currentIndex = 1; + int _currentIndex = 0; int pageSelected = 2; - CreateEReferralRequestModel createEReferralRequestModel = - new CreateEReferralRequestModel(); + CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel(); @override void initState() { @@ -40,37 +40,139 @@ class _StartIndexForNewEReferralState extends State @override Widget build(BuildContext context) { return Scaffold( - body: SafeArea( - child: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 0.78, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - NewEReferralStepOnePage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - NewEReferralStepTowPage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - NewEReferralStepThreePage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - ], + body: Container( + height: double.infinity, + child: Column( + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 12,right: 12,top: 12), + child: Row( + children: [ + Expanded( + child: showProgress( + title: TranslationBase.of(context).RequesterInfo, + status: _currentIndex == 0 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 0 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green, + ), + ), + Expanded( + child: showProgress( + title: TranslationBase.of(context).patientInfo, + status: _currentIndex == 1 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 1 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 1 + ? CustomColors.orange + : _currentIndex > 1 + ? CustomColors.green + : CustomColors.grey2, + ), + ), + showProgress( + title: TranslationBase.of(context).otherInfo, + status: _currentIndex == 2 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked, + color: _currentIndex == 2 + ? CustomColors.orange + : _currentIndex > 3 + ? CustomColors.green + : CustomColors.grey2, + isNeedBorder: false, + ), + ], + ), ), - ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + NewEReferralStepOnePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepTowPage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepThreePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + ], + ), + ), + ], ), ), ); } + + Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 26, + height: 26, + decoration: containerRadius(color, 200), + child: Icon( + Icons.done, + color: Colors.white, + size: 16, + ), + ), + if (isNeedBorder) + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: mDivider(Colors.grey), + )), + ], + ), + mHeight(8), + Text( + title, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ), + mHeight(2), + Container( + padding: EdgeInsets.all(5), + decoration: containerRadius(color.withOpacity(0.2), 4), + child: Text( + status, + style: TextStyle( + fontSize: 8, + fontWeight: FontWeight.w600, + letterSpacing: -0.32, + color: color, + ), + ), + ), + ], + ) + ], + ); + } } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index d7e2d099..3d260317 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -12,12 +12,15 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dial import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:flutter/cupertino.dart'; @@ -36,13 +39,14 @@ class NewEReferralStepOnePage extends StatefulWidget { class _NewEReferralStepOnePageState extends State { TextEditingController _nameTextController = TextEditingController(); - TextEditingController _mobileTextController = TextEditingController(); + GetAllRelationshipTypeResponseModel _selectedRelation; String email; AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); ProjectViewModel projectViewModel; + String mobileNo = ""; // todo create a model for Country // todo use country from the json @@ -59,11 +63,11 @@ class _NewEReferralStepOnePageState extends State { SMSOTP( context, 1, - _selectedCountry['code'] + _mobileTextController.text, - (value) { + _selectedCountry['code'] + mobileNo, + (value) { submit(model, value); }, - () => { + () => { Navigator.pop(context), }, ).displayDialog(context); @@ -74,108 +78,135 @@ class _NewEReferralStepOnePageState extends State { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getRelationTypes(), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - Center( - child: Texts( - TranslationBase.of(context).referralRequesterInformation, + onModelReady: (model) => model.getRelationTypes(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Container( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).enterReferralRequesterName, - controller: _nameTextController, - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], + Text( + TranslationBase.of(context).referralRequesterInformation, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), ), - ), - SizedBox( - height: 12, - ), - MobileNumberTextFiled( - controller: _mobileTextController, - code: _selectedCountry == null ? "11" : _selectedCountry["code"], - ), - SizedBox( - height: 12, - ), - Center( - child: Texts( - TranslationBase.of(context).requesterRelationship, - textAlign: TextAlign.center, + SizedBox( + height: 12, ), - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getRelationName()), Icon(Icons.arrow_drop_down)], + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: true)), + SizedBox( + height: 12, + ), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + _selectedCountry = value; + }); + }), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectRelationship, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + Text( + getRelationName(), + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + ], + ), + ), + Icon(Icons.arrow_drop_down), + ], + ), ), ), - ), - ], + ], + ), ), ), ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - width: double.infinity, - padding: EdgeInsets.all(9), - child: DefaultButton( - TranslationBase.of(context).next, - (_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty) - ? null - : () async { - Future.delayed(new Duration(milliseconds: 300)).then((value) async { - GifLoaderDialogUtils.showMyDialog(context); - SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( - zipCode: _selectedCountry['code'], - patientMobileNumber: int.parse(_mobileTextController.text), - ); - await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); - GifLoaderDialogUtils.hideDialog(context); - showSMSDialog(model); - }); - }, - disabledColor: Colors.grey, + Card( + margin: EdgeInsets.zero, + shape: cardRadius(0), + elevation: 20, + child: Container( + // color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + width: double.infinity, + child: DefaultButton( + TranslationBase.of(context).next, + (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty) + ? null + : () async { + Future.delayed(new Duration(milliseconds: 300)).then((value) async { + GifLoaderDialogUtils.showMyDialog(context); + SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( + zipCode: _selectedCountry['code'], + patientMobileNumber: int.parse(mobileNo), + ); + await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); + GifLoaderDialogUtils.hideDialog(context); + showSMSDialog(model); + }); + }, + disabledColor: Colors.grey, + ), + ), ), - ))); + ], + ), + ), + ), + ); } void submit(EReferralViewModel model, code) async { @@ -195,7 +226,7 @@ class _NewEReferralStepOnePageState extends State { Navigator.of(context).pop(); widget.changePageViewIndex(1); widget.createEReferralRequestModel.requesterName = _nameTextController.text; - widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + _mobileTextController.text; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + mobileNo; widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD; } }); @@ -216,20 +247,93 @@ class _NewEReferralStepOnePageState extends State { ); } - void confirmSelectCountryTypeDialog() { - showDialog( - context: context, - child: SelectCountryDialog( - selectedCountry: _selectedCountry, - onValueSelected: (value) { - setState(() { - _selectedCountry = value; - }); - }, + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), ), ); } + // void confirmSelectCountryTypeDialog() { + // showDialog( + // context: context, + // child: SelectCountryDialog( + // selectedCountry: _selectedCountry, + // onValueSelected: (value) { + // setState(() { + // _selectedCountry = value; + // }); + // }, + // ), + // ); + // } + String getRelationName() { if (_selectedRelation != null) { if (projectViewModel.isArabic) { @@ -237,7 +341,7 @@ class _NewEReferralStepOnePageState extends State { } return _selectedRelation.textEn; } else - return TranslationBase.of(context).selectRelationship; + return ""; } String getCountryName() { diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 7a1a954b..858a65a5 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -66,316 +67,297 @@ class _NewEReferralStepThreePageState extends State { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - Center( - child: Texts( - TranslationBase.of(context).otherInfo, - textAlign: TextAlign.center, - ), - ), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 9), - child: Texts( - TranslationBase.of(context).medicalReport, - color: Colors.grey, - fontSize: 17, - ), - ), - ], - ), - InkWell( - onTap: () { - ImageOptions.showImageOptions( - context, - (String image, File file) { - setState(() { - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); - medicalReportImages.add(eReferralAttachment); - }); - }, - ); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Center( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.attach_file), - Texts( - TranslationBase.of(context).selectAttachment, - variant: 'bodyText', - textAlign: TextAlign.center, - ), - ], - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + TranslationBase.of(context).otherInfo, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).medicalReport, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, ), ), - ), - SizedBox( - height: 12, - ), - ...List.generate( + + ...List.generate( medicalReportImages.length, (index) => Container( - margin: EdgeInsets.all(10), - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + padding: EdgeInsets.only(top: 6,bottom: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(FontAwesomeIcons.paperclip), - SizedBox( - width: 8, - ), - Texts( - medicalReportImages[index].fileName, - ), - ], + Texts( + medicalReportImages[index].fileName, ), - InkWell( - onTap: () { - setState(() { - medicalReportImages.remove(medicalReportImages[index]); - }); - }, - child: Icon( - FontAwesomeIcons.trashAlt, - color: Colors.red[300], - )) ], ), - )), - ], + InkWell( + onTap: () { + setState(() { + medicalReportImages.remove(medicalReportImages[index]); + }); + }, + child: Icon( + Icons.close, + color: Colors.red[300], + )) + ], + ), + ), + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions( + context, + (String image, File file) { + setState(() { + EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); + medicalReportImages.add(eReferralAttachment); + }); + }, + ); + }, + child: Padding( + padding: EdgeInsets.only(top: 12,bottom: 12), + child: Text( + TranslationBase.of(context).selectAttachment, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + decoration: TextDecoration.underline, + color: CustomColors.accentColor, + ), + ), + ), + ), + ], + ), ), - ), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.only(top: 10), - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Column( - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( - children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).preferredBranch, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - key: projectDropdownKey, - hint: Text(TranslationBase.of(context).selectPreferredBranch), - value: projectDropdownValue, - iconSize: 0, - isExpanded: true, - style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), - items: projectsList.map((item) { - return new DropdownMenuItem( - value: item.mainProjectID.toString() + "," + item.name.toString(), - child: new Text(item.name), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - projectDropdownValue = newValue; - print(projectDropdownValue); - }); - }, - ), - ), + Icon(Icons.attach_file), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(top: 10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Column( + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).preferredBranch, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + key: projectDropdownKey, + hint: Text(TranslationBase.of(context).selectPreferredBranch), + value: projectDropdownValue, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.mainProjectID.toString() + "," + item.name.toString(), + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + print(projectDropdownValue); + }); + }, ), - ], + ), ), - ), - Icon(Icons.keyboard_arrow_down), - ], - )), - ], - ), - ), - SizedBox( - height: 12, - ), - Container( - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Column( + ], + ), + ), + Icon(Icons.keyboard_arrow_down), + ], + )), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - children: [ - Checkbox( - value: isPatientInsured, - activeColor: Colors.black38, - onChanged: (bool newValue) { - setState(() { - isPatientInsured = newValue; - }); - }), - Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - TranslationBase.of(context).insuredPatientReferral, - fontSize: 17, - ), - ), - ], + Checkbox( + value: isPatientInsured, + activeColor: Colors.black38, + onChanged: (bool newValue) { + setState(() { + isPatientInsured = newValue; + }); + }), + Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + TranslationBase.of(context).insuredPatientReferral, + fontSize: 17, + ), ), ], ), ], ), + ], + ), + ), + if (isPatientInsured) + SizedBox( + height: 12, + ), + Opacity( + opacity: isPatientInsured ? 1 : 0, + child: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, ), - if (isPatientInsured) - SizedBox( - height: 12, - ), - Opacity( - opacity: isPatientInsured ? 1 : 0, - child: Container( - padding: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - child: Column( - children: [ - InkWell( - onTap: () { - ImageOptions.showImageOptions(context, (String image, File file) { - setState(() { - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); - - insuredPatientImages = [eReferralAttachment]; - }); - }); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Center( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.attach_file), - Texts( - 'selected attachment', - variant: 'bodyText', - textAlign: TextAlign.center, - ), - ], - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).medicalReport, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, ), ), - ), - SizedBox( - height: 12, - ), - ...List.generate( + + ...List.generate( insuredPatientImages.length, (index) => Container( - margin: EdgeInsets.all(10), - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + padding: EdgeInsets.only(top: 6,bottom: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(FontAwesomeIcons.paperclip), - SizedBox( - width: 8, - ), - Texts( - 'image ${index + 1}.png', - ), - ], + Texts( + 'image ${index + 1}.png', ), - InkWell( - onTap: () { - setState(() { - insuredPatientImages.remove(insuredPatientImages[index]); - }); - }, - child: Icon( - FontAwesomeIcons.trashAlt, - color: Colors.red[300], - )) ], ), - )), - ], + InkWell( + onTap: () { + setState(() { + insuredPatientImages.remove(insuredPatientImages[index]); + }); + }, + child: Icon( + Icons.close, + color: Colors.red[300], + ), + ) + ], + ), + ), + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image, File file) { + setState(() { + EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); + + insuredPatientImages = [eReferralAttachment]; + }); + }); + }, + child: Padding( + padding: const EdgeInsets.only(top: 12,bottom: 12), + child: Text( + TranslationBase.of(context).selectAttachment, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + decoration: TextDecoration.underline, + color: CustomColors.accentColor, + ), + ), + ), + ), + ], + ), ), - ), - ), - SizedBox( - height: 12, + Icon(Icons.attach_file), + ], ), - ], + ), ), - ), + ], ), ), ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 734c5f28..ee477127 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -7,18 +7,20 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../dialogs/select_city_dialog.dart'; - class NewEReferralStepTowPage extends StatefulWidget { final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; @@ -32,20 +34,14 @@ class NewEReferralStepTowPage extends StatefulWidget { class _NewEReferralStepTowPageState extends State { TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController(); - TextEditingController _mobileTextController = TextEditingController(); - GetAllCitiesResponseModel _selectedCity ; + String mobileNo = ""; + GetAllCitiesResponseModel _selectedCity; + GetAllSharedRecordsByStatusList selectedPatientFamily; // todo create a model for Country // todo use country from the json - dynamic _selectedCountry = { - "name": "Saudi Arabia", - "name_ar": "المملكة العربية السعودية", - "code": "+966", - "countryCode": "SA", - "pattern": "5xxxxxxxx", - "maxLength": 9 - }; + dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; @@ -57,143 +53,222 @@ class _NewEReferralStepTowPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getAllCities(), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - Center( - child: Texts( - TranslationBase.of(context).patientInfo, -// "Patient information", - textAlign: TextAlign.center, - ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).enterIdentificationNumber, - controller: _patientIdentificationTextController, - keyboardType:TextInputType.number , - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).patientName, - controller: _patientNameTextController, - ), - SizedBox( - height: 12, + onModelReady: (model) => model.getAllCities(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + TranslationBase.of(context).patientInfo, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getCountryName()), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), - SizedBox( - height: 12, - ), - MobileNumberTextFiled( - controller: _mobileTextController, - code: _selectedCountry == null - ? "11" - : _selectedCountry["code"], + ), + SizedBox( + height: 12, + ), + inputWidget(TranslationBase.of(context).enterIdentificationNumber, "", _patientIdentificationTextController, isInputTypeNum: true), + SizedBox( + height: 12, + ), + inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: true), + SizedBox( + height: 12, + ), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + _selectedCountry = value; + }); + }), + SizedBox( + height: 12, + ), + Text( + TranslationBase.of(context).patientLocated, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), - SizedBox( - height: 12, - ), - Center( - child: Texts( - TranslationBase.of(context).patientLocated, - textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectCityDialog( - model.allCities), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getRelationName()), - Icon(Icons.arrow_drop_down) - ], - ), + child: InkWell( + onTap: () => confirmSelectCityDialog(model.allCities), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectCity, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + Text( + getRelationName(), + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + ], + ), + ), + Icon(Icons.arrow_drop_down), + ], ), ), - SizedBox( - height: 12, - ), - - SizedBox( - height: 12, - ), - ], - ), + ), + SizedBox( + height: 12, + ), + ], ), ), ), ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - width: double.infinity, - padding: EdgeInsets.all(9), - child: DefaultButton( - TranslationBase.of(context).next, - (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| - _selectedCity == null || - _mobileTextController.text.isEmpty) ? null : () { - this.widget.changePageViewIndex(2); - this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); - this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; - this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; - this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); - this.widget.createEReferralRequestModel.cityName = _selectedCity.description; - }, - disabledColor: Colors.grey, + Card( + margin: EdgeInsets.zero, + shape: cardRadius(0), + elevation: 20, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(12), + child: DefaultButton( + TranslationBase.of(context).next, + (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty || _selectedCity == null || mobileNo.isEmpty) + ? null + : () { + this.widget.changePageViewIndex(2); + this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text); + this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; + this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo; + this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); + this.widget.createEReferralRequestModel.cityName = _selectedCity.description; + }, + disabledColor: Colors.grey, + ), ), - ))); - + ) + ], + ), + ), + ); + } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); } - void confirmSelectCityDialog( - List cities) { + void confirmSelectCityDialog(List cities) { showDialog( context: context, child: SelectCityDialog( @@ -238,12 +313,7 @@ class _NewEReferralStepTowPageState extends State { } class MobileNumberTextFiled extends StatelessWidget { - const MobileNumberTextFiled({ - Key key, - this.controller, - this.code - }) : super(key: key); - + const MobileNumberTextFiled({Key key, this.controller, this.code}) : super(key: key); final TextEditingController controller; final String code; @@ -252,8 +322,7 @@ class MobileNumberTextFiled extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: EdgeInsets.all(5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.white), child: Row(children: [ Expanded( flex: 1, @@ -274,8 +343,7 @@ class MobileNumberTextFiled extends StatelessWidget { child: TextField( controller: controller, keyboardType: TextInputType.phone, - decoration: InputDecoration( - border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), + decoration: InputDecoration(border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), ), ), ) diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart index 2fb7e41a..52338edd 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart @@ -10,8 +10,7 @@ class SelectCityDialog extends StatefulWidget { final Function(GetAllCitiesResponseModel) onValueSelected; GetAllCitiesResponseModel selectedCity; - SelectCityDialog( - {Key key, this.cities, this.onValueSelected, this.selectedCity}); + SelectCityDialog({Key key, this.cities, this.onValueSelected, this.selectedCity}); @override _SelectCityDialogState createState() => _SelectCityDialogState(); @@ -26,104 +25,109 @@ class _SelectCityDialogState extends State { @override Widget build(BuildContext context) { - return SimpleDialog( - children: [ - Column( - children: [ - Divider(), - ...List.generate( - widget.cities.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, + return Dialog( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( children: [ - SizedBox( - height: 2, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - widget.selectedCity = widget.cities[index]; - }); - }, - child: ListTile( - title: Text(widget.cities[index].description), - leading: Radio( - value: widget.cities[index], - groupValue: widget.selectedCity, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - widget.selectedCity = value; - }); - }, - ), - ), + ...List.generate( + widget.cities.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, ), - ) - ], - ), - SizedBox( - height: 5.0, + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedCity = widget.cities[index]; + }); + }, + child: ListTile( + title: Text(widget.cities[index].description), + leading: Radio( + value: widget.cities[index], + groupValue: widget.selectedCity, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedCity = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), ), ], ), ), - SizedBox( - height: 5.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, ), ), ), ), ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(widget.selectedCity); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedCity); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), ), ), - ], - ) - ], - ) - ], + ), + ], + ) + ], + ), ); } } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index 1308532f..78d3bca3 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -84,6 +84,7 @@ class _EReferralPageState extends State Expanded( child: TabBarView( physics: BouncingScrollPhysics(), + controller: _tabController, children: [ StartIndexForNewEReferral(), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 356e8eb1..048af5a2 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -36,7 +37,7 @@ class SearchForReferralsPage extends StatefulWidget { class _SearchForReferralsPageState extends State { TextEditingController _searchTextController = TextEditingController(); - TextEditingController _mobileTextController = TextEditingController(); + String mobileNo = ""; bool _isSubmitted = false; dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; @@ -80,55 +81,106 @@ class _SearchForReferralsPageState extends State { SizedBox( height: 10, ), - InkWell( - onTap: () => selectSearchCriteriaDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], + // InkWell( + // onTap: () => selectSearchCriteriaDialog(), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], + // ), + // ), + // ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", - controller: _searchTextController, - onChanged: (_) { - setState(() {}); - }, - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: InkWell( + onTap: () => selectSearchCriteriaDialog(), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectSearchCriteria, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + Text( + getSearchCriteriaName(), + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + ], + ), + ), + Icon(Icons.arrow_drop_down), + ], ), ), ), SizedBox( height: 12, ), - MobileNumberTextFiled( - controller: _mobileTextController, - onChange: (_) { - setState(() {}); - }, - code: _selectedCountry == null ? "11" : _selectedCountry["code"], + + inputWidget(selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", "", _searchTextController, isInputTypeNum: true), + + SizedBox( + height: 12, ), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + _selectedCountry = value; + }); + }), + // InkWell( + // onTap: () => confirmSelectCountryTypeDialog(), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), + // MobileNumberTextFiled( + // controller: _mobileTextController, + // onChange: (_) { + // setState(() {}); + // }, + // code: _selectedCountry == null ? "11" : _selectedCountry["code"], + // ), SizedBox( height: 12, ), @@ -200,11 +252,11 @@ class _SearchForReferralsPageState extends State { padding: EdgeInsets.all(14), child: DefaultButton( TranslationBase.of(context).search, - (_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty) + (_searchTextController.text.isEmpty || mobileNo.isEmpty) ? null : () async { SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( - patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text, + patientMobileNumber: _selectedCountry['code'] + mobileNo, ); if (selectedCriteria.value == 1) { searchEReferralRequestModel.identificationNo = _searchTextController.text; @@ -258,6 +310,79 @@ class _SearchForReferralsPageState extends State { ); } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } + String getSearchCriteriaName() { return selectedCriteria.name; } diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index 9aca16ff..463b0e70 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -17,4 +17,5 @@ class CustomColors { static const Color appBackgroudGreyColor = Color(0xFFF7F7F7); static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8); static const Color green = Color(0xFF359846); + static const Color orange = Color(0xFFCC9B14); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index edc2e2e0..0d60500e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2385,6 +2385,12 @@ class TranslationBase { String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode]; String get enterComplainNumber => localizedValues["enterComplainNumber"][locale.languageCode]; + + String get RequesterInfo => localizedValues["RequesterInfo"][locale.languageCode]; + String get PatientInfo => localizedValues["PatientInfo"][locale.languageCode]; + String get OtherInfo => localizedValues["OtherInfo"][locale.languageCode]; + String get inPrgress => localizedValues["inPrgress"][locale.languageCode]; + String get locked => localizedValues["locked"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index b7e0f16b..2c796768 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -50,6 +50,7 @@ import 'gif_loader_dialog_utils.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); + class Utils { // static ProgressDialog pr; @@ -518,6 +519,8 @@ class Utils { return medical; } + + static List myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { List medical = List(); From 4780039cc7d2d3f563d16017c914dfaeda1f44f2 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 17 Oct 2021 17:41:31 +0300 Subject: [PATCH 28/33] family file change --- assets/images/new-design/allow.svg | 6 + assets/images/new-design/delete.svg | 6 + assets/images/new-design/reject.svg | 6 + assets/images/new-design/switch.svg | 10 + lib/config/localized_values.dart | 13 +- lib/pages/DrawerPages/family/my-family.dart | 575 ++++++++++++-------- lib/theme/theme_value.dart | 8 +- 7 files changed, 399 insertions(+), 225 deletions(-) create mode 100644 assets/images/new-design/allow.svg create mode 100644 assets/images/new-design/delete.svg create mode 100644 assets/images/new-design/reject.svg create mode 100644 assets/images/new-design/switch.svg diff --git a/assets/images/new-design/allow.svg b/assets/images/new-design/allow.svg new file mode 100644 index 00000000..a38817f2 --- /dev/null +++ b/assets/images/new-design/allow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new-design/delete.svg b/assets/images/new-design/delete.svg new file mode 100644 index 00000000..49b4d9d9 --- /dev/null +++ b/assets/images/new-design/delete.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new-design/reject.svg b/assets/images/new-design/reject.svg new file mode 100644 index 00000000..d2e9b868 --- /dev/null +++ b/assets/images/new-design/reject.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new-design/switch.svg b/assets/images/new-design/switch.svg new file mode 100644 index 00000000..2283d4a2 --- /dev/null +++ b/assets/images/new-design/switch.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f67c1850..86763360 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -231,7 +231,7 @@ const Map localizedValues = { "unit": {"en": "Unit", "ar": "وحدة"}, "request": {"en": "Request", "ar": "طلبات الاضافة"}, "member-name": {"en": "Member Name", "ar": "اسم العضو"}, - "switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, + "switch-login": {"en": "Switch", "ar": "تغير "}, "remove-member": {"en": "Remove", "ar": "حذف"}, "allow-view": {"en": "Allow", "ar": "قبول"}, "reject-view": {"en": "Reject", "ar": "رفض"}, @@ -606,7 +606,6 @@ const Map localizedValues = { "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, - "select": {"en": "Select", "ar": "يختار"}, "i-am": {"en": "I am", "ar": "أنا"}, "years-old": {"en": "years old", "ar": "سنة"}, @@ -1508,9 +1507,9 @@ const Map localizedValues = { "enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"}, "enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"}, "please_select_from_below_options": {"en": "Please select from below options:", "ar": "الرجاء التحديد من الخيارات أدناه:"}, - "selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" }, - "recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" }, - "modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" }, - "prefferedMode": { "en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه" }, - "permissionsBellow": { "en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه" }, + "selectLanguage": {"en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة"}, + "recAlert": {"en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟"}, + "modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"}, + "prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"}, + "permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"}, }; diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 784c7c6a..afad2d99 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -1,6 +1,5 @@ import 'dart:ui'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; @@ -35,6 +34,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; @@ -123,7 +125,7 @@ class _MyFamily extends State with TickerProviderStateMixin { controller: _tabController, children: [myFamilyDetails(context), myFamilyRequest(context)], ) - : Container(child: AppText('Loading..')), + : Container(child: AppText('')), ), ], ), @@ -153,7 +155,7 @@ class _MyFamily extends State with TickerProviderStateMixin { builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: - return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); + 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)); @@ -163,88 +165,97 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) return Card( margin: EdgeInsets.all(10), - shape: cardRadius(15), + shape: cardRadius(25), color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0), elevation: 3, child: Container( // height: 130, width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach, - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach, + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + 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 + + ', ' + + snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription, + fontSize: 12, + color: Colors.white), + ], ), - 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 + - ', ' + - snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription, - fontSize: 12, - color: Colors.white), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Column( children: [ - Container( - margin: EdgeInsets.only(top: 5.0), - width: 100.0, - child: DefaultButton( - TranslationBase.of(context).switchUser, - () { - // setState(() { - // isSwitchUser = value; - // }); - switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], AppGlobal.context); + SizedBox(height: 10), + InkWell( + onTap: () { + switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); }, - fontSize: 12.0, - color: Colors.white, - textColor: Colors.black, - ), + child: Container( + decoration: BoxDecoration(color: Color.fromRGBO(255, 255, 255, 0.2), borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.fromLTRB(15, 10, 15, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset("assets/images/new-design/switch.svg", + height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E)), + SizedBox( + width: 5, + ), + // CupertinoSwitch( + // value: isSwitchUser, + // onChanged: (value) { + // setState(() { + // isSwitchUser = value; + // }); + // if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); + // }, + // ), + Texts(TranslationBase.of(context).switchUser, + color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E), + fontSize: 12, + fontWeight: FontWeight.bold) + ], + ))), + SizedBox( + height: 10, ), - // Row( - // children: [ - // CupertinoSwitch( - // value: isSwitchUser, - // onChanged: (value) { - // setState(() { - // isSwitchUser = value; - // }); - // if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); - // }, - // ), - // Texts( - // TranslationBase.of(context).switchUser, - // color: Colors.white, - // fontSize: 12, - // ) - // ], - // ), InkWell( onTap: () { deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context); }, - child: Row( - children: [ - Texts( - TranslationBase.of(context).delete, - color: Colors.white, - fontSize: 12, - ), - Icon( - Icons.delete, - color: Colors.white, - ), - ], - )) + child: Container( + decoration: BoxDecoration(color: Color.fromRGBO(255, 255, 255, 0.2), borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.fromLTRB(15, 10, 15, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset("assets/images/new-design/delete.svg", + height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E)), + SizedBox( + width: 5, + ), + Texts(TranslationBase.of(context).delete, + color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E), + fontSize: 12, + fontWeight: FontWeight.bold), + ], + ))), + SizedBox(height: 10), ], - ) + ), ], ))); else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0) @@ -277,157 +288,288 @@ class _MyFamily extends State with TickerProviderStateMixin { margin: EdgeInsets.only(top: 10), child: Column( children: [ - RoundedContainer( - child: ExpansionTile( - title: Text( - TranslationBase.of(context).userViewRequest, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), - ), - children: [ - FutureBuilder( + 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 Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); + return SizedBox(); + 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: [ + 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: [ + 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: 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: [ 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)), + Expanded(flex: 1, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600)) ])), - Divider(color: Colors.black, height: 1), + 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: Text(result.patientName)), - 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.delete, - color: Colors.black, - ), - onPressed: () { - acceptRemoveRequest(result.iD, 4, 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, ), - RoundedContainer( - child: ExpansionTile( - title: Text( - TranslationBase.of(context).sentRequest, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), - ), - children: [ - FutureBuilder( - future: getSentRequest(), // 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), - height: SizeConfig.screenHeight * .3, - child: Card( - elevation: 3, - shape: cardRadius(8), - child: SingleChildScrollView( - 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: 2, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600)) - ])), - Divider(color: Colors.black, height: 1), - Column( - children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded(flex: 3, child: Text(result.patientName)), - Expanded( - flex: 2, - child: AppText( - result.statusDescription, - color: result.status == 3 ? Colors.green : Colors.red, - )), - ], - )); - }).toList(), - ) - ], - )))); - } - }) - ], - )), - RoundedContainer( - child: ExpansionTile( - title: Text( - TranslationBase.of(context).userView, - 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), + 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: [ @@ -445,22 +587,29 @@ class _MyFamily extends State with TickerProviderStateMixin { child: AppText( TranslationBase.of(context).delete, fontWeight: FontWeight.w600, + textAlign: TextAlign.center, )), ])), - Divider(color: Colors.black), + 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: AppText(result.patientName)), + Expanded( + flex: 3, + child: Texts( + result.patientName, + fontWeight: FontWeight.w600, + fontSize: 12, + )), Expanded( flex: 1, child: IconButton( icon: Icon( Icons.delete, - color: Colors.black, + color: Colors.red, ), onPressed: () { deactivateRequest(result.iD, 5, context); @@ -471,11 +620,9 @@ class _MyFamily extends State with TickerProviderStateMixin { }).toList()) ]) ], - ))); - } - }) - ], - )) + )); + } + }))) ], ), ), diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index 2044d8e4..96392b4a 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -16,7 +16,7 @@ defaultTheme({fontName}) { return ThemeData( fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.blue, + primarySwatch: Colors.red, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, pageTransitionsTheme: const PageTransitionsTheme( @@ -66,7 +66,7 @@ invertThemes({fontName}) { return ThemeData( fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.blue, + primarySwatch: Colors.red, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.dark, @@ -110,7 +110,7 @@ bwThemes({fontName}) { return ThemeData( fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.blue, + primarySwatch: Colors.red, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.dark, @@ -165,7 +165,7 @@ dimTheme({fontName}) { return ThemeData( fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.blue, + primarySwatch: Colors.red, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.dark, From 6d3ead24e11956803e4dc2a02f05b510b55a1294 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Oct 2021 17:54:38 +0300 Subject: [PATCH 29/33] localisation update --- lib/config/localized_values.dart | 1 + .../E-Referral/dialogs/select_search_criteria_dialog.dart | 2 +- lib/uitl/translations_delegate_base.dart | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cb531689..243d7754 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1517,4 +1517,5 @@ const Map localizedValues = { "cancelAppointment": { "en": "Cancel Appt.", "ar": "الغاء الموعد" }, "updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"}, "patientAge": {"en": "y", "ar": "سنة"}, + "searchCriteria": { "en": "Select Search Criteria", "ar": "حدد معايير البحث" }, }; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart index e4beed9e..e970f208 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_search_criteria_dialog.dart @@ -35,7 +35,7 @@ class _SelectSearchCriteriaDialogState extends State children: [ Column( children: [ - Texts(" Select Search Criteria", fontSize: 20,), + Text(TranslationBase.of(context).searchCriteria), Divider(), ...List.generate( widget.searchCriteria.length, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ba8dba86..fffdb672 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2392,8 +2392,7 @@ class TranslationBase { String get patientAge => localizedValues["patientAge"][locale.languageCode]; - - + String get searchCriteria => localizedValues["searchCriteria"][locale.languageCode]; } From 5a9ab457e5cbe191532ed7242a3549ccc565aaec Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 17 Oct 2021 18:15:05 +0300 Subject: [PATCH 30/33] family files --- lib/pages/DrawerPages/family/my-family.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index afad2d99..127c68ce 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -162,6 +162,7 @@ class _MyFamily extends State with TickerProviderStateMixin { else return ListView.separated( itemBuilder: (context, index) { + snapshot.data.getAllSharedRecordsByStatusList[index].gender = 2; if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) return Card( margin: EdgeInsets.all(10), @@ -204,7 +205,7 @@ class _MyFamily extends State with TickerProviderStateMixin { switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); }, child: Container( - decoration: BoxDecoration(color: Color.fromRGBO(255, 255, 255, 0.2), borderRadius: BorderRadius.circular(20)), + decoration: BoxDecoration(color: Colors.black.withOpacity(0.15), borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.fromLTRB(15, 10, 15, 10), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -237,7 +238,7 @@ class _MyFamily extends State with TickerProviderStateMixin { deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context); }, child: Container( - decoration: BoxDecoration(color: Color.fromRGBO(255, 255, 255, 0.2), borderRadius: BorderRadius.circular(20)), + decoration: BoxDecoration(color: Colors.black.withOpacity(0.15), borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.fromLTRB(15, 10, 15, 10), child: Row( mainAxisAlignment: MainAxisAlignment.center, From 18f35a22bb778cc6d0885cdfcf3552a0050bf9e2 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 17 Oct 2021 18:19:15 +0300 Subject: [PATCH 31/33] FAMILY FILE --- lib/pages/DrawerPages/family/my-family.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 127c68ce..ba8d971e 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -205,7 +205,7 @@ class _MyFamily extends State with TickerProviderStateMixin { switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); }, child: Container( - decoration: BoxDecoration(color: Colors.black.withOpacity(0.15), borderRadius: BorderRadius.circular(20)), + decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.fromLTRB(15, 10, 15, 10), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -238,7 +238,7 @@ class _MyFamily extends State with TickerProviderStateMixin { deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context); }, child: Container( - decoration: BoxDecoration(color: Colors.black.withOpacity(0.15), borderRadius: BorderRadius.circular(20)), + decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.fromLTRB(15, 10, 15, 10), child: Row( mainAxisAlignment: MainAxisAlignment.center, From 03882c166c4a15e55940fdaf58b4bf923bce1a48 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Oct 2021 10:58:31 +0300 Subject: [PATCH 32/33] Translation & UI updates --- lib/config/localized_values.dart | 4 +-- lib/core/service/client/base_app_client.dart | 9 ++++--- .../new_e_referral_step_one_page.dart | 27 +++++++++---------- .../new_e_referral_step_three_page.dart | 16 ++++++----- .../new_e_referral_step_two_page.dart | 4 +-- .../E-Referral/referral_details.dart | 2 +- .../E-Referral/search_for_referrals_page.dart | 4 +-- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d9e3d168..ff622419 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1072,8 +1072,8 @@ const Map localizedValues = { "added-child": {"en": "The request was successful. You have added a child to the vaccination schedule subscription service.", "ar": "تمت الاضافة بنجاح."}, "appUpdate": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"}, "ereferralSaveSuccess": { - "en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ", - "ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة" + "en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process.", + "ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية." }, "help": {"en": "Help", "ar": "مساعدة"}, "habibRobotText": { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 50fbcdc7..a4edd32e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -120,10 +120,11 @@ class BaseAppClient { // if(body.containsKey("patientOutSa")) // body.remove("PatientOutSA"); // - // body['PatientID'] = 1018977; - // body['TokenID'] = "@dm!n"; - // body['IdentificationNo'] = "1009199553"; - // body['MobileNo'] = "966545156035"; + body['PatientID'] = 1018977; + body['TokenID'] = "@dm!n"; + body['IdentificationNo'] = "1009199553"; + body['MobileNo'] = "966545156035"; + body['PatientMobileNumber'] = "966545156035"; print("URL : $url"); final jsonBody = json.encode(body); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 3d260317..0ae7c202 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -8,10 +8,8 @@ import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -19,7 +17,6 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; @@ -107,7 +104,7 @@ class _NewEReferralStepOnePageState extends State { SizedBox( height: 12, ), - Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: true)), + inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: false), SizedBox( height: 12, ), @@ -187,17 +184,17 @@ class _NewEReferralStepOnePageState extends State { (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty) ? null : () async { - Future.delayed(new Duration(milliseconds: 300)).then((value) async { - GifLoaderDialogUtils.showMyDialog(context); - SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( - zipCode: _selectedCountry['code'], - patientMobileNumber: int.parse(mobileNo), - ); - await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); - GifLoaderDialogUtils.hideDialog(context); - showSMSDialog(model); - }); - }, + Future.delayed(new Duration(milliseconds: 300)).then((value) async { + GifLoaderDialogUtils.showMyDialog(context); + SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( + zipCode: _selectedCountry['code'], + patientMobileNumber: int.parse(mobileNo), + ); + await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); + GifLoaderDialogUtils.hideDialog(context); + showSMSDialog(model); + }); + }, disabledColor: Colors.grey, ), ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 9e211e93..164d7b50 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -238,7 +238,7 @@ class _NewEReferralStepThreePageState extends State { height: 12, ), Container( - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( children: [ Row( @@ -248,17 +248,19 @@ class _NewEReferralStepThreePageState extends State { children: [ Checkbox( value: isPatientInsured, - activeColor: Colors.black38, + activeColor: CustomColors.accentColor, onChanged: (bool newValue) { setState(() { isPatientInsured = newValue; }); }), Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - TranslationBase.of(context).insuredPatientReferral, - fontSize: 17, + padding: const EdgeInsets.all(5.0), + child: Text( + TranslationBase.of(context).insuredPatientReferral, style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600 + ), ), ), ], @@ -385,7 +387,7 @@ class _NewEReferralStepThreePageState extends State { Utils.showErrorToast(model.error); } else { GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast(message: "Referral sent successfully"); + AppToast.showSuccessToast(message: TranslationBase.of(context).ereferralSaveSuccess); } }); }, diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index ee477127..5bf031fe 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -41,7 +41,7 @@ class _NewEReferralStepTowPageState extends State { // todo create a model for Country // todo use country from the json - dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; + dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; @@ -85,7 +85,7 @@ class _NewEReferralStepTowPageState extends State { SizedBox( height: 12, ), - inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: true), + inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: false), SizedBox( height: 12, ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart index 1eaf9875..a519e720 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart @@ -30,7 +30,7 @@ class _ReferralDetailsState extends State { Container( width: double.infinity, child: Card( - elevation: 3.0, + elevation: 0.0, shape: cardRadius(12), margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 4cafe6c4..78b5455d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -140,7 +140,7 @@ class _SearchForReferralsPageState extends State { height: 12, ), - inputWidget(selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", "", _searchTextController, isInputTypeNum: true), + inputWidget(selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, "", _searchTextController, isInputTypeNum: true), SizedBox( height: 12, @@ -203,8 +203,8 @@ class _SearchForReferralsPageState extends State { ); }, child: Card( + elevation: 0.0, shape: cardRadius(12), - margin: EdgeInsets.all(10), child: Padding( padding: const EdgeInsets.all(12.0), child: Row( From babb48b1dbab63fd1880dfffbab5bef46731d5b0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Oct 2021 11:13:15 +0300 Subject: [PATCH 33/33] base app client changes --- lib/core/service/client/base_app_client.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a4edd32e..ac96e35e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -120,11 +120,11 @@ class BaseAppClient { // if(body.containsKey("patientOutSa")) // body.remove("PatientOutSA"); // - body['PatientID'] = 1018977; - body['TokenID'] = "@dm!n"; - body['IdentificationNo'] = "1009199553"; - body['MobileNo'] = "966545156035"; - body['PatientMobileNumber'] = "966545156035"; + // body['PatientID'] = 1018977; + // body['TokenID'] = "@dm!n"; + // body['IdentificationNo'] = "1009199553"; + // body['MobileNo'] = "966545156035"; + // body['PatientMobileNumber'] = "966545156035"; print("URL : $url"); final jsonBody = json.encode(body);