From 831780555c94b64c4878b5fcef52556234567371 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 12 Sep 2021 15:07:54 +0300 Subject: [PATCH 1/8] CMC 1.0 --- lib/config/localized_values.dart | 1 + .../NewCMC/new_cmc_page.dart | 26 +- .../NewCMC/new_cmc_step_one_page.dart | 301 ++++++--------- .../ComprehensiveMedicalCheckup/cmc_page.dart | 135 +++---- .../orders_log_details_page.dart | 361 +++++++++--------- .../HomeHealthCare/StepsWidget.dart | 191 +++------ .../fragments/home_page_fragment2.dart | 9 +- .../landing/widgets/logged_slider_view.dart | 8 +- lib/uitl/translations_delegate_base.dart | 42 ++ lib/widgets/drawer/app_drawer_widget.dart | 2 +- 10 files changed, 463 insertions(+), 613 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 03e966ff..5ab7d487 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1175,6 +1175,7 @@ const Map localizedValues = { "generalHealth": {"en": "General Health", "ar": "صحة عامة"}, "womanHealth": {"en": "Women's Health", "ar": "صحة المرأة"}, "bmi": {"en": "BMI", "ar": "الكتلة"}, + "bloodType": {"en": "Blood Type:", "ar": ":فصيلة الدم"}, "calc-health": {"en": "Calculators", "ar": "الصحية"}, "calories": {"en": "Calories", "ar": "سعرات"}, "bmr": {"en": "BMR", "ar": "معدل الأيض القاعدي"}, diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index f314a9bf..5ce0cc3e 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -122,16 +122,7 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { height: MediaQuery.of(context).size.height * 0.8, child: Column( children: [ - if (widget.model.cmcAllOrderDetail.length == 0) - Container( - margin: EdgeInsets.only( - left: MediaQuery.of(context).size.width * 0.05, - right: MediaQuery.of(context).size.width * 0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, - ), - ), + Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), @@ -376,12 +367,15 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { ), ), ) - : NewCMCStepOnePage( - changePageViewIndex: changePageViewIndex, - cMCInsertPresOrderRequestModel: - cMCInsertPresOrderRequestModel, - model: widget.model, - ), + : Container( + color: Colors.red, + child: NewCMCStepOnePage( + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, + model: widget.model, + ), + ), NewCMCStepTowPage( longitude: _longitude, latitude: _latitude, 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 c07b8345..5bf65ef4 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 @@ -3,8 +3,10 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.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/others/app_scaffold_widget.dart'; @@ -17,12 +19,7 @@ class NewCMCStepOnePage extends StatefulWidget { final Function changePageViewIndex; final CMCViewModel model; - const NewCMCStepOnePage( - {Key key, - this.cMCInsertPresOrderRequestModel, - this.model, - this.changePageViewIndex}) - : super(key: key); + const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key); @override _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); @@ -44,175 +41,107 @@ class _NewCMCStepOnePageState extends State { body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( - margin: EdgeInsets.all(12), + margin: EdgeInsets.only(left: 12, right: 12), child: Center( child: Column( children: [ - FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - Texts( - TranslationBase.of(context).selectService, - textAlign: TextAlign.center, - ), - Column( - children: - widget.model.cmcAllServicesList.map((service) { - return Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), - child: Column( - children: [ - Row( - children: [ - Radio( - value: service.serviceID, - activeColor: Colors.red[800], - onChanged: (newValue) async { - PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: service.price, - serviceID: service.serviceID - .toString(), - selectedServiceName: - service.description, - selectedServiceNameAR: - service.descriptionN, - recordID: 1, - totalPrice: - service.totalPrice, - vAT: service.vAT); - setState(() { - widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList = [ - patientERCMCInsertServicesList - ]; - }); - CMCGetItemsRequestModel - cMCGetItemsRequestModel = - new CMCGetItemsRequestModel( - checkupType: newValue); - await widget.model.getCheckupItems( - cMCGetItemsRequestModel: - cMCGetItemsRequestModel); - }, - groupValue: widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList - .length > - 0 - ? int.parse(widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList[ - 0] - .serviceID) - : 1), - Expanded( - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - projectViewModel.isArabic - ? service.descriptionN - : service.description, - fontSize: 15, - ), - ), - ), - ], + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return Row( + children: [ + Radio( + value: widget.model.cmcAllServicesList[index].serviceID, + activeColor: Colors.red[800], + onChanged: (newValue) async { + 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, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index].totalPrice, + vAT: widget.model.cmcAllServicesList[index].vAT); + setState(() { + widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; + }); + CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue); + await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel); + }, + groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0 + ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID) + : 1), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + left: 10, + right: 10, + top: 20, + bottom: 20, + ), + child: Text( + projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - ], + ), ), - ); - }).toList(), - ), - ], - ), - ), - SizedBox( - height: 30, - ), - Container( - color: Theme.of(context).primaryColor, - width: double.infinity, - child: Column( - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 10, left: 10), - child: Texts( - TranslationBase.of(context).coveredService, - fontWeight: FontWeight.bold, - )) + ), ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: widget.model.checkupItems.map((item) { - return Center( - child: FractionallySizedBox( - widthFactor: 1, - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - color: Theme.of(context).primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 5, top: 5), - decoration: BoxDecoration( - border: BorderDirectional( - bottom: BorderSide( - style: BorderStyle.solid, - width: 0.5, - color: Colors.grey)), - //borderRadius: , - color: - Theme.of(context).primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only( - right: 10, left: 10), - child: Texts(item.itemName, - fontSize: 15, - fontWeight: FontWeight.bold), - ), - ], - ), - ), - SizedBox( - height: 12, - ), - ], - ), + ); + }, + separatorBuilder: (context, index) { + return mDivider(Colors.grey); + }, + itemCount: widget.model.cmcAllServicesList.length), + 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, ), ), ); - }).toList()), - ], + }, + separatorBuilder: (context, index) { + return mDivider(Colors.grey); + }, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: widget.model.checkupItems.length, + ), + ], + ), ), - ) + ), + mHeight(MediaQuery.of(context).size.height * 0.12), ], ), ), @@ -221,44 +150,30 @@ class _NewCMCStepOnePageState extends State { bottomSheet: Container( height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, + color: CustomColors.appBackgroudGreyColor, child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( label: TranslationBase.of(context).next, textColor: Theme.of(context).backgroundColor, - color: Colors.grey[800], + color: CustomColors.accentColor, onTap: () async { - if (widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList.length != - 0 || - widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList == - null) { + if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) { int index = widget.model.cmcAllServicesList.length; - PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: widget - .model.cmcAllServicesList[index - 1].price, - serviceID: widget - .model.cmcAllServicesList[index - 1].serviceID - .toString(), - selectedServiceName: widget.model - .cmcAllServicesList[index - 1].description, - selectedServiceNameAR: widget.model - .cmcAllServicesList[index - 1].descriptionN, - recordID: 1, - totalPrice: widget - .model.cmcAllServicesList[index - 1].totalPrice, - vAT: - widget.model.cmcAllServicesList[index - 1].vAT); + PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index - 1].price, + serviceID: widget.model.cmcAllServicesList[index - 1].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index - 1].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index - 1].descriptionN, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index - 1].totalPrice, + vAT: widget.model.cmcAllServicesList[index - 1].vAT); - widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList = [ - patientERCMCInsertServicesList - ]; + widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; await widget.model.getCustomerInfo(); if (widget.model.state == ViewState.ErrorLocal) { Utils.showErrorToast(); diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index d7ebad6c..65b2d878 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.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'; @@ -42,93 +43,69 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin { isShowAppBar: true, description: TranslationBase.of(context).infoCMC, imagesInfo: [ - ImagesInfo( - imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', - imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png') + ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png'), ], appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, - 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).primaryColor.withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.7), + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( + children: [ + Container( + height: 60.0, + width: double.infinity, + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: CustomColors.accentColor, + labelColor: Colors.black, + labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Center( + child: Text( + TranslationBase.of(context).comprehensiveMedicalCheckup, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.34, ), - color: Theme.of(context).primaryColor), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.37, - child: Center( - child: Texts(TranslationBase.of(context) - .comprehensiveMedicalCheckup), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.37, - child: Center( - child: - Texts(TranslationBase.of(context).orderLog), - ), - ), - ], ), ), - ), - ), - ], - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - NewCMCPage( - model: model, + Center( + child: Text( + TranslationBase.of(context).orderLog, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.34, + ), + ), ), - OrdersLogDetailsPage( - model: model, - ) ], ), - ) - ], - ), + ), + ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + NewCMCPage( + model: model, + ), + OrdersLogDetailsPage( + model: model, + ) + ], + ), + ) + ], ), ), ); diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index ec686e70..b98d97c9 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -22,26 +22,20 @@ class OrdersLogDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage( - CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { + void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { showDialog( context: context, child: ConfirmCancelOrderDialog( model: model, onTap: () async { - UpdatePresOrderRequestModel updatePresOrderRequestModel = - UpdatePresOrderRequestModel( - presOrderID: order.iD, - rejectionReason: "", - presOrderStatus: 4, editedBy: 3); + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); await model.updateCmcPresOrder(updatePresOrderRequestModel); - if(model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); await model.getCmcAllPresOrders(); } }, @@ -49,205 +43,210 @@ class OrdersLogDetailsPage extends StatelessWidget { } return AppScaffold( - isShowAppBar: false, - baseViewModel: model, - 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: 50, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: model.cmcAllPresOrders.map((order) { - return Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.cmcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 12), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 15, bottom: 15, top: 8, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .requestID, - bold: false, + ), + // borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).requestID, + style: TextStyle( fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - SizedBox( - height: 4, + ), + SizedBox( + height: 4, + ), + Text( + order.iD.toString(), + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - Texts( - order.iD.toString(), - fontSize: 22, - ), - ], - ), + ), + ], ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .OrderStatus, - bold: false, + ), + // borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).OrderStatus, + style: TextStyle( fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - SizedBox( - height: 4, + ), + SizedBox( + height: 4, + ), + Text( + projectViewModel.isArabic ? order.descriptionN : order.description, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - Texts( - - projectViewModel.isArabic ? order - .descriptionN : order.description, - fontSize: 22, - ), - ], - ), + ), + ], ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).pickupDate, - bold: false, + ), + // borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).pickupDate, + style: TextStyle( fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - SizedBox( - height: 4, + ), + SizedBox( + height: 4, + ), + Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(order.createdOn)), - fontSize: 22, - ), - ], - ), + ), + ], ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), + ), + Container( + width: double.infinity, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: (order.status == 1 || order.status == 2) ? Colors.grey : Colors.transparent, + width: (order.status == 1 || order.status == 2) ? 1.0 : 0, ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).orderLocation, - bold: false, + ), + // borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).orderLocation, + style: TextStyle( fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - SizedBox( - height: 4, - ), - Texts( - !projectViewModel.isArabic?order. - projectDescription.toString() : - order - .projectDescriptionN - .toString(), - fontSize: 22, + ), + SizedBox( + height: 4, + ), + Text( + !projectViewModel.isArabic ? order.projectDescription.toString() : order.projectDescriptionN.toString(), + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, ), - ], - ), - ), - SizedBox( - height: 12, + ), + ], ), - if (order.status == 1 ||order.status == 2 ) + ), + (order.status == 1 || order.status == 2) + ? SizedBox( + height: 12, + ) + : Container(), + if (order.status == 1 || order.status == 2) Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, + width: MediaQuery.of(context).size.width * 0.85, child: SecondaryButton( label: TranslationBase.of(context).cancel.toUpperCase(), onTap: () { - showConfirmMessage(model, - order); - } - , + showConfirmMessage(model, order); + }, color: Colors.red[800], disabled: false, - textColor: Theme - .of(context) - .backgroundColor), + textColor: Theme.of(context).backgroundColor), ), ), - SizedBox( - height: 22, - ), - ], - ), - ); + (order.status == 1 || order.status == 2) + ? SizedBox( + height: 12, + ) + : SizedBox( + height: 2, + ), + ], + ), + ); }).toList()) ], ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart index 370544d0..4ea50670 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart @@ -1,4 +1,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,170 +14,87 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return !projectViewModel.isArabic? Stack( - children: [ - Container( - height: 50, - width: MediaQuery.of(context).size.width, - color: Colors.transparent, - child: Center( - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), - ), - ), - Positioned( - top: 10, - left: 0, - child: InkWell( - onTap: () => changeCurrentTab(0), - child: Container( - width: 35, - height: 35, - decoration: BoxDecoration( - border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), - shape: BoxShape.circle, - color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, - ), - child: Center( - child: Texts( - '1', - color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], - ), - ), - ), - ), - ), - Positioned( - top: 10, - left: MediaQuery.of(context).size.width * 0.42, - child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(1) : null, - child: Container( - width: 35, - height: 35, - decoration: BoxDecoration( - border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), - shape: BoxShape.circle, - color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, - ), - child: Center( - child: Texts( - '2', - color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], - ), - ), - ), - ), - ), - Positioned( - top: 10, - right: 0, - child: InkWell( - onTap: () => index == 2 ?changeCurrentTab(3) : null, - child: Container( - width: 35, - height: 35, - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(color: Colors.black,width: 0.75), - color: index == 2 ? Colors.grey[800] : Colors.white, - ), - child: Center( - child: Texts( - '3', - color: index == 2 ? Colors.white : Colors.grey[800], - ), - ), - ), - ), - ), + return showRow(); + } - ], - ):Stack( - children: [ - Container( - height: 50, - width: MediaQuery.of(context).size.width, - color: Colors.transparent, - child: Center( - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), - ), - ), - Positioned( - top: 10, - right: 0, - child: InkWell( + Widget showRow() { + return Container( + width: double.infinity, + child: Row( + children: [ + InkWell( onTap: () => changeCurrentTab(0), child: Container( width: 35, height: 35, - decoration: BoxDecoration( - border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), - shape: BoxShape.circle, - color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, - ), + decoration: containerColorRadiusBorder( + index == 0 + ? CustomColors.accentColor + : index > 0 + ? Colors.green[700] + : Colors.white, + 2000, + Colors.black), child: Center( - child: Texts( - '1', - color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + child: Text( + "1", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), ), ), - ), - Positioned( - top: 10, - left: MediaQuery.of(context).size.width * 0.42, - child: InkWell( + Expanded(child: mDivider(Colors.grey)), + InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Container( width: 35, height: 35, - decoration: BoxDecoration( - border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), - shape: BoxShape.circle, - color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, - ), + decoration: containerColorRadiusBorder( + index == 1 + ? CustomColors.accentColor + : index > 1 + ? Colors.green[700] + : Colors.white, + 2000, + Colors.black), child: Center( - child: Texts( - '2', - color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + child: Text( + "2", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), ), ), - ), - Positioned( - top: 10, - left: 0, - child: InkWell( - onTap: () => index == 2 ?changeCurrentTab(3) : null, + Expanded(child: mDivider(Colors.grey)), + InkWell( + onTap: () => index == 2 ? changeCurrentTab(3) : null, child: Container( width: 35, height: 35, - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(color: Colors.black,width: 0.75), - color: index == 2 ? Colors.grey[800] : Colors.white, + decoration: containerColorRadiusBorder( + index == 2 ? CustomColors.accentColor : Colors.white, + 2000, + Colors.black, ), child: Center( - child: Texts( - '3', - color: index == 2 ? Colors.white : Colors.grey[800], + child: Text( + "3", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), ), ), - ), - ], + ], + ), ); } } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 68bf2ffe..c0a28d8f 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -81,10 +81,11 @@ class _HomePageFragment2State extends State { navigateTo(context, MedicalProfilePageNew()); }, child: LoggedSliderView( - projectViewModel, - new SliderData(TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, - "", bannerColor[0].darkColor, bannerColor[0].lightColor), - widget.model), + projectViewModel, + new SliderData(TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, + "", bannerColor[0].darkColor, bannerColor[0].lightColor), + widget.model, + ), ), ), ) diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index 958135d0..067cb148 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -138,7 +138,7 @@ class LoggedSliderView extends StatelessWidget { padding: const EdgeInsets.only(left: 20, right: 20), child: Row( children: [ - Expanded( + Expanded( flex: 3, child: Row( children: [ SvgPicture.asset( @@ -158,7 +158,7 @@ class LoggedSliderView extends StatelessWidget { SizedBox( width: 3, ), - Expanded( + Expanded( flex: 3, child: Row( children: [ SvgPicture.asset( @@ -175,6 +175,7 @@ class LoggedSliderView extends StatelessWidget { width: 3, ), Expanded( + flex: 3, child: Row( children: [ SvgPicture.asset( @@ -183,10 +184,11 @@ class LoggedSliderView extends StatelessWidget { height: 12, ), mWidth(6), - Texts('${TranslationBase.of(context).bloodD}: ${model.booldType}', color: Colors.white, fontSize: 10) + Texts('${TranslationBase.of(context).bloodType1} ${model.booldType}', color: Colors.white, fontSize: 10) ], ), ), + mFlex(1), ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b7efad42..3cb7ce31 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -20,6 +20,8 @@ class TranslationBase { String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get bloodType1 => localizedValues['bloodType'][locale.languageCode]; + String get settings => localizedValues['settings'][locale.languageCode]; String get language => localizedValues['language'][locale.languageCode]; @@ -93,18 +95,25 @@ class TranslationBase { String get patientShare => localizedValues['patientShare'][locale.languageCode]; String get neverWait => localizedValues['neverWait'][locale.languageCode]; + String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; String get reminderTitle => localizedValues['reminderTitle'][locale.languageCode]; + String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; String get appointmentCalendar => localizedValues['appointmentCalendar'][locale.languageCode]; + String get appointmentSuccess => localizedValues['appointmentSuccess'][locale.languageCode]; String get confirm => localizedValues['confirm'][locale.languageCode]; + String get pressAgain => localizedValues['pressAgain'][locale.languageCode]; + String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; + String get doctorFilter => localizedValues['doctorFilter'][locale.languageCode]; + String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; @@ -724,11 +733,15 @@ class TranslationBase { String get sentRequest => localizedValues['sent-requests'][locale.languageCode]; String get km => localizedValues['km'][locale.languageCode]; + String get km_ => localizedValues['km_'][locale.languageCode]; + String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get clickHere => localizedValues['ClickHere'][locale.languageCode]; String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; @@ -802,7 +815,9 @@ class TranslationBase { String get country => localizedValues['country'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode]; + String get averageWaitingTime => localizedValues['averageWaitingTime'][locale.languageCode]; + String get waterConsumedInWeek => localizedValues['WaterConsumedInWeek'][locale.languageCode]; String get waterConsumedInMonth => localizedValues['WaterConsumedInMonth'][locale.languageCode]; @@ -1069,12 +1084,16 @@ class TranslationBase { String get consumed => localizedValues['consumed'][locale.languageCode]; String get transferred => localizedValues['transferred'][locale.languageCode]; + String get checkBeneficiary => localizedValues['checkBeneficiary'][locale.languageCode]; + String get beneficiaryName => localizedValues['beneficiaryName'][locale.languageCode]; + String get accountActivation => localizedValues['accountActivation'][locale.languageCode]; + String get nonRecommended => localizedValues['nonRecommended'][locale.languageCode]; @@ -2094,7 +2113,9 @@ class TranslationBase { String get upComingPayOption => localizedValues["upcoming-pay-options"][locale.languageCode]; String get pleaseAcceptTerms => localizedValues["please-accept-terms"][locale.languageCode]; + String get pleaseSelectAllQuestionToContinue => localizedValues["pleaseSelectAllQuestionToContinue"][locale.languageCode]; + String get type => localizedValues["type"][locale.languageCode]; String get eReferralInfo => localizedValues["info-ereferral"][locale.languageCode]; @@ -2132,36 +2153,57 @@ class TranslationBase { String get noThankyou => localizedValues["no-thankyou"][locale.languageCode]; String get visitClinic => localizedValues["visit-clinic"][locale.languageCode]; + String get generateCovidCertificate => localizedValues["generate-covid-certificate"][locale.languageCode]; + String get isReportOutsideKsa => localizedValues["is-report-outside-ksa"][locale.languageCode]; + String get passportNumber => localizedValues["passport-number"][locale.languageCode]; + String get enterPassportNumber => localizedValues["enter-passport-number"][locale.languageCode]; + String get validPassportNumber => localizedValues["valid-passport-number"][locale.languageCode]; + String get continuePlan => localizedValues["continue-plan"][locale.languageCode]; + String get dentalProcedureList => localizedValues["dental-procedure-list"][locale.languageCode]; + String get aboutApp => localizedValues["about-app"][locale.languageCode]; + String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode]; + String get timeNeeded => localizedValues["time-needed"][locale.languageCode]; + String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode]; + String get infoEye => localizedValues["info-eye"][locale.languageCode]; + String get infoVaccines => localizedValues["info-vaccines"][locale.languageCode]; + String get infoTrackers => localizedValues["info-trackers"][locale.languageCode]; + String get infoHealthData => localizedValues["info-health-data"][locale.languageCode]; + String get infoAskDoc => localizedValues["info-ask-doc"][locale.languageCode]; + String get infoAutoWifi => localizedValues["info-auto-wifi"][locale.languageCode]; + String get autoWifi => localizedValues["auto-wifi"][locale.languageCode]; + String get childVaccineInfo => localizedValues["child-vaccine-info"][locale.languageCode]; + String get h2oInfo => localizedValues["h2o-info"][locale.languageCode]; + String get askDocEmpty => localizedValues["ask-doc-empty"][locale.languageCode]; } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index f5e633ec..6fa0a4ec 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -163,7 +163,7 @@ class _AppDrawerState extends State { } else { projectProvider.changeLanguage('ar'); } - var themeNotifier = Provider.of(context, listen: false); + var themeNotifier = Provider.of(context, listen: true); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); }, ), From b3f3558eacd594f8df410bfae7267e6ff9636efe Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 12 Sep 2021 16:44:48 +0300 Subject: [PATCH 2/8] CMC 1.2 --- lib/uitl/translations_delegate_base.dart | 35 ++++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 3bc2e7ea..474b13cd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -736,11 +736,9 @@ class TranslationBase { String get km_ => localizedValues['km_'][locale.languageCode]; - String get patientHealthSummaryReport => - localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; - String get toViewTheTermsAndConditions => - localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; String get clickHere => localizedValues['ClickHere'][locale.languageCode]; @@ -1085,17 +1083,13 @@ class TranslationBase { String get transferred => localizedValues['transferred'][locale.languageCode]; - String get checkBeneficiary => - localizedValues['checkBeneficiary'][locale.languageCode]; + String get checkBeneficiary => localizedValues['checkBeneficiary'][locale.languageCode]; - String get beneficiaryName => - localizedValues['beneficiaryName'][locale.languageCode]; + String get beneficiaryName => localizedValues['beneficiaryName'][locale.languageCode]; - String get accountActivation => - localizedValues['accountActivation'][locale.languageCode]; + String get accountActivation => localizedValues['accountActivation'][locale.languageCode]; - String get nonRecommended => - localizedValues['nonRecommended'][locale.languageCode]; + String get nonRecommended => localizedValues['nonRecommended'][locale.languageCode]; String get lakumTransfer => localizedValues['lakumTransfer'][locale.languageCode]; @@ -2173,24 +2167,41 @@ class TranslationBase { String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode]; String get timeNeeded => localizedValues["time-needed"][locale.languageCode]; + String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode]; + String get infoEye => localizedValues["info-eye"][locale.languageCode]; + String get infoVaccines => localizedValues["info-vaccines"][locale.languageCode]; + String get infoTrackers => localizedValues["info-trackers"][locale.languageCode]; + String get infoHealthData => localizedValues["info-health-data"][locale.languageCode]; + String get infoAskDoc => localizedValues["info-ask-doc"][locale.languageCode]; + String get infoAutoWifi => localizedValues["info-auto-wifi"][locale.languageCode]; + String get autoWifi => localizedValues["auto-wifi"][locale.languageCode]; + String get childVaccineInfo => localizedValues["child-vaccine-info"][locale.languageCode]; + String get h2oInfo => localizedValues["h2o-info"][locale.languageCode]; + String get sysdias => localizedValues["sys/dias"][locale.languageCode]; + String get arm => localizedValues["arm"][locale.languageCode]; + String get removeMeasure => localizedValues["remove-measure"][locale.languageCode]; + String get selectArm => localizedValues["select-arm"][locale.languageCode]; String get askDocEmpty => localizedValues["ask-doc-empty"][locale.languageCode]; + String get onlineClinics => localizedValues["online-clinics"][locale.languageCode]; + String get offlineClinics => localizedValues["offline-clinics"][locale.languageCode]; + String get clinicSchedule => localizedValues["clinic-schedule"][locale.languageCode]; } From ec646a7039097413481a64399f8028896c2c3c62 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 12 Sep 2021 18:03:02 +0300 Subject: [PATCH 3/8] My Invoice fixes, Prescription page fixes --- .../DentalInvoiceDetailResponse.dart | 18 +- lib/pages/BookAppointment/DoctorProfile.dart | 2 +- .../my_invoices/invoice_detail_page.dart | 270 ++++++------------ .../medical/my_invoices/my_invoice_page.dart | 7 +- .../prescription_items_page.dart | 16 +- .../prescriptions/prescriptions_page.dart | 4 +- .../radiology/radiology_details_page.dart | 41 +-- lib/uitl/utils.dart | 12 +- .../data_display/medical/doctor_card.dart | 22 +- 9 files changed, 133 insertions(+), 259 deletions(-) diff --git a/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart b/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart index 83ef9f5a..6c6d605a 100644 --- a/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart +++ b/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart @@ -267,27 +267,27 @@ class ListConsultation { dynamic projectID; dynamic doctorID; dynamic grandTotal; - int quantity; - int total; + dynamic quantity; + dynamic total; dynamic discount; - int subTotal; + dynamic subTotal; dynamic invoiceNo; dynamic createdOn; String procedureID; String procedureName; dynamic procedureNameN; dynamic procedurePrice; - int patientShare; + dynamic patientShare; dynamic companyShare; - int totalPatientShare; + dynamic totalPatientShare; dynamic totalCompanyShare; dynamic totalShare; dynamic discountAmount; - int vATPercentage; - int patientVATAmount; + dynamic vATPercentage; + dynamic patientVATAmount; dynamic companyVATAmount; dynamic totalVATAmount; - int price; + dynamic price; dynamic patientID; dynamic patientName; dynamic patientNameN; @@ -316,7 +316,7 @@ class ListConsultation { dynamic totalPatientShareWithQuantity; dynamic legalName; dynamic legalNameN; - int advanceAdjustment; + dynamic advanceAdjustment; ListConsultation( {this.projectID, diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 4c87ebe4..0dec924a 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -112,7 +112,7 @@ class _DoctorProfileState extends State with TickerProviderStateM widget.doctor.nationalityFlagURL, widget.doctor.doctorRate, widget.doctor.actualDoctorRate, - widget.doctor.noOfPatientsRate, + widget.docProfileList.noOfPatientsRate, "", ), buttonIcon: 'assets/images/new/Boo_ Appointment.svg', diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 3d62a661..618c5676 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_serv 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/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -19,14 +19,13 @@ class InvoiceDetail extends StatelessWidget { final DentalInvoiceDetailResponse dentalInvoiceDetailResponse; final BuildContext context; - int totalServiceRate = 0; - int totalDiscount = 0; - int totalVAT = 0; - int subTotal = 0; - int grandTotal = 0; + dynamic totalServiceRate = 0; + dynamic totalDiscount = 0; + dynamic totalVAT = 0; + dynamic subTotal = 0; + dynamic grandTotal = 0; - InvoiceDetail(this.doctor, this.listDentalAppointments, - this.dentalInvoiceDetailResponse, this.context); + InvoiceDetail(this.doctor, this.listDentalAppointments, this.dentalInvoiceDetailResponse, this.context); @override Widget build(BuildContext context) { @@ -35,18 +34,16 @@ class InvoiceDetail extends StatelessWidget { appBarTitle: TranslationBase.of(context).myInvoice, isShowAppBar: true, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, body: SingleChildScrollView( child: Container( child: Column( children: [ - DoctorView( - doctor: doctor, - isLiveCareAppointment: false, - isShowFlag: false), + DoctorView(doctor: doctor, isLiveCareAppointment: false, isShowFlag: false), Container( margin: EdgeInsets.only(left: 10.0, right: 10.0), - padding: EdgeInsets.only( - top: 10.0, left: 10.0, right: 10.0, bottom: 10.0), + padding: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0, bottom: 10.0), decoration: BoxDecoration( color: Colors.grey[800], borderRadius: BorderRadius.only( @@ -57,34 +54,17 @@ class InvoiceDetail extends StatelessWidget { child: Table( children: [ TableRow(children: [ - Text("Description", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold)), - Text("Quantity", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold)), - Text("Price", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold)), - Text("Total", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold)), + Text("Description", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Quantity", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Price", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Total", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), ]), ], ), ), Container( margin: EdgeInsets.only(top: 0.0, left: 10.0, right: 10.0), - padding: EdgeInsets.only( - top: 10.0, left: 10.0, right: 10.0, bottom: 15.0), + padding: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0, bottom: 15.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( @@ -102,97 +82,59 @@ class InvoiceDetail extends StatelessWidget { ), Container( child: AppExpandableNotifier( - title: "Total Price: " + grandTotal.toString() + " SAR", + title: "Total Price: " + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].grandTotal.toString() + " SAR", isExpand: true, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + bodyWidget: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Table( children: [ - Table( - children: [ - TableRow(children: [ - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Discount: ", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(totalDiscount.toString() + " SAR", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - ]), - TableRow(children: [ - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text( - "VAT (" + - dentalInvoiceDetailResponse - .listEInvoiceForDental[0] - .listConsultation[0] - .vATPercentage - .toString() + - "%)", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(totalVAT.toString() + " SAR", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - ]), - TableRow(children: [ - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Total: ", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(grandTotal.toString() + " SAR", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - ]), - TableRow(children: [ - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Paid: ", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - Container( - margin: - EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text(grandTotal.toString() + " SAR", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - ]), - ], - ), - ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Discount: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].discountAmount.toString() + " SAR", + textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("VAT (" + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() + "%)", + textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].patientVATAmount.toString() + " SAR", + textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Total: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].totalPatientShare.toString() + " SAR", + textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Paid: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0, bottom: 10.0), + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].totalPatientShare.toString() + " SAR", + textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + ), + ]), + ], + ), + ]), ), ), Container( @@ -204,50 +146,27 @@ class InvoiceDetail extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 0.0, left: 10.0, right: 10.0), - padding: EdgeInsets.only( - top: 10.0, left: 10.0, right: 10.0, bottom: 15.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8))), + padding: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0, bottom: 15.0), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8))), child: Table(children: [ TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Insurance: ", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), + child: Text("Insurance: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0, bottom: 5.0), - child: Text( - dentalInvoiceDetailResponse - .listEInvoiceForDental[0].companyName, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), ]), TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Insurance ID: ", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), + child: Text("Insurance ID: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text( - dentalInvoiceDetailResponse - .listEInvoiceForDental[0].insuranceID, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold)), + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), ]), ]), @@ -261,15 +180,9 @@ class InvoiceDetail extends StatelessWidget { ), 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: () { - sendInvoiceEmail(); - }, - label: TranslationBase.of(context).sendEmail, - backgroundColor: Colors.red[900], - ), + // height: 70.0, + margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0, bottom: 20.0), + child: DefaultButton(TranslationBase.of(context).sendEmail, () => {sendInvoiceEmail()}), ), ); } @@ -278,14 +191,10 @@ class InvoiceDetail extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(context); MyInvoicesService myInvoicesService = new MyInvoicesService(); - myInvoicesService - .sendDentalAppointmentInvoiceEmail( - 12, listDentalAppointments.appointmentNo, context) - .then((res) { + myInvoicesService.sendDentalAppointmentInvoiceEmail(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast( - message: TranslationBase.of(context).emailSentSuccessfully); + AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -299,37 +208,24 @@ class InvoiceDetail extends StatelessWidget { List fullData(context) { List tableRow = []; - dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation - .forEach((lab) { + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.forEach((lab) { tableRow.add( TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text(lab.procedureName, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.w400)), + child: Text(lab.procedureName, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(lab.quantity.toString(), - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.w400)), + child: Text(lab.quantity.toString(), textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(lab.price.toString() + " SAR", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.w400)), + child: Text(lab.price.toString() + " SAR", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(lab.total.toString() + " SAR", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.w400)), + child: Text(lab.total.toString() + " SAR", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), ), ]), ); diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index b49879bc..c634a587 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -46,6 +46,8 @@ class _MyInvoicesState extends State { appBarTitle: TranslationBase.of(context).myInvoice, isShowAppBar: true, isShowDecPage: true, + showNewAppBar: true, + showNewAppBarTitle: true, imagesInfo: imagesInfo, body: Container( child: SingleChildScrollView( @@ -206,17 +208,17 @@ class _MyInvoicesState extends State { doctor.date = listDentalAppointments.appointmentDate; doctor.actualDoctorRate = 0; doctor.doctorImageURL = listDentalAppointments.doctorImageURL; + doctor.projectID = listDentalAppointments.projectID; doctor.dayName = listDentalAppointments.invoiceNo; doctor.doctorTitle = "Dr."; doctor.clinicName = "InvoiceNo: " + listDentalAppointments.invoiceNo.toString(); - myInvoicesService.getDentalAppointmentInvoice(12, listDentalAppointments.appointmentNo, context).then((res) { + myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); setState(() { if (res['MessageStatus'] == 1) { dentalInvoiceDetailResponse = DentalInvoiceDetailResponse.fromJson(res); - print(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length); Navigator.push( context, FadePage( @@ -235,7 +237,6 @@ class _MyInvoicesState extends State { GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err.toString()); - Navigator.of(context).pop(); }); } diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 76a6d839..2b12304a 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; @@ -10,15 +9,14 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_de 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/button.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.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 '../../../widgets/dialogs/confirm_send_email_dialog.dart'; import 'PrescriptionIDeliveryAddressPage.dart'; @@ -327,13 +325,12 @@ class PrescriptionItemsPage extends StatelessWidget { ), Container( width: double.infinity, - padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 2), + padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 20), child: Container( width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: TranslationBase.of(context).resendOrder, - backgroundColor: Colors.green[800], - onTap: () { + child: DefaultButton( + TranslationBase.of(context).resendOrder, + () { Navigator.push( context, FadePage( @@ -345,6 +342,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), ); }, + color: Colors.green[800], ), ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 1d5f92c5..da6f6761 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -74,8 +74,8 @@ class PrescriptionsPage extends StatelessWidget { subName: prescriptions.name, isInOutPatient: prescriptions.isInOutPatient, isLiveCareAppointment: prescriptions.isLiveCareAppointment, - appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions - .appointmentDate)), + // appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions + // .appointmentDate)), date: DateUtil.convertStringToDate(prescriptions .appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)), ); diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 9779df1b..1a61def8 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,15 +1,12 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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_scaffold_widget.dart'; @@ -90,13 +87,10 @@ class RadiologyDetailsPage extends StatelessWidget { (projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8)) ? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) ? Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () { - launch(model.radImageURL); - }, - label: TranslationBase.of(context).openRad, - backgroundColor: CustomColors.accentColor, + child: DefaultButton( + TranslationBase.of(context).openRad, + () => {launch(model.radImageURL)}, + textColor: Colors.white, ), ) : Container() @@ -109,31 +103,6 @@ class RadiologyDetailsPage extends StatelessWidget { ], ), ), - // bottomSheet: (projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8)) - // ? Container( - // width: double.infinity, - // height: finalRadiology.dIAPACSURL != "" ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.14, - // color: Colors.grey[100], - // child: Column( - // mainAxisSize: MainAxisSize.min, - // children: [ - // Divider(), - // if (projectViewModel.havePrivilege(8)) - // Container( - // width: MediaQuery.of(context).size.width * 0.8, - // child: Button( - // onTap: () { - // showConfirmMessage(finalRadiology: finalRadiology, model: model); - // }, - // label: TranslationBase.of(context).sendCopyRad, - // loading: model.state == ViewState.BusyLocal, - // backgroundColor: Theme.of(context).primaryColor, - // ), - // ) - // ], - // ), - // ) - // : Container(), ), ); } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index c9d3f548..3d68cce5 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -9,6 +9,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; @@ -21,7 +22,6 @@ import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart' import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; -import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/pages/medical/my_invoices/my_invoice_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; @@ -308,6 +308,16 @@ class Utils { MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).myInvoice, + imagePath: 'invoice_list.svg', + subTitle: TranslationBase.of(context).invoicesList, + isEnable: projectViewModel.havePrivilege(14), + ), + )); + medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, child: MedicalProfileItem( diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 74031ce1..f333ab3c 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -1,13 +1,10 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; @@ -138,7 +135,7 @@ class DoctorCard extends StatelessWidget { style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12), ), ], - ) + ), ], ), Row( @@ -221,11 +218,14 @@ class DoctorCard extends StatelessWidget { Widget myRichText(String title, String value, bool isArabic) { return RichText( maxLines: 1, - text: TextSpan(text: title, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: [ - TextSpan( - text: " $value", - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ) - ]), + text: TextSpan( + text: title, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), + children: [ + TextSpan( + text: " $value", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ) + ]), ); } From e890c80831db498412fd8db85cf62258b30bd8ac Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Tue, 14 Sep 2021 12:18:02 +0300 Subject: [PATCH 4/8] CMC 1.3 --- .../AlHabibMedicalService/cmc_service.dart | 107 ++--- .../AlHabibMedicalService/cmc_view_model.dart | 73 ++-- .../Dialog/confirm_cancel_order_dialog.dart | 55 ++- .../Dialog/confirm_dialog.dart | 98 +++++ .../NewCMC/new_cmc_page.dart | 396 +++++------------- .../NewCMC/new_cmc_step_one_page.dart | 14 +- .../NewCMC/new_cmc_step_three_page.dart | 192 +++++---- .../NewCMC/new_cmc_step_tow_page.dart | 261 ++++++------ .../dialogs/select_location_dialog.dart | 43 +- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 10 files changed, 614 insertions(+), 627 deletions(-) create mode 100644 lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index 9e99f3ad..11c306dc 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -23,12 +23,9 @@ class CMCService extends BaseService { bool isOrderUpdated; Future getCMCAllServices() async { - - - GetCMCServicesRequestModel getCMCServicesRequestModel= new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo); + GetCMCServicesRequestModel getCMCServicesRequestModel = new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo); hasError = false; - await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, - onSuccess: (dynamic response, int statusCode) { + 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)); @@ -39,79 +36,67 @@ class CMCService extends BaseService { }, body: getCMCServicesRequestModel.toJson()); } - - Future getCmcAllPresOrders() async { - - GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel= GetHHCAllPresOrdersRequestModel(); + GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); hasError = false; - await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, - onSuccess: (dynamic response, int statusCode) { - cmcAllPresOrdersList.clear(); - cmcAllOrderDetail.clear(); - response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) - cmcAllPresOrdersList - .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { + cmcAllPresOrdersList.clear(); + cmcAllOrderDetail.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { + if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) cmcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data)); }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getHHCAllPresOrdersRequestModel.toJson()); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getHHCAllPresOrdersRequestModel.toJson()); } Future getOrderDetailByOrderID(GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel) async { - hasError = false; - await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID, - onSuccess: (dynamic response, int statusCode) { - cmcAllOrderDetail.clear(); - response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) { - cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getOrderDetailByOrderIDRequestModel.toJson()); + await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID, onSuccess: (dynamic response, int statusCode) { + cmcAllOrderDetail.clear(); + response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) { + cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getOrderDetailByOrderIDRequestModel.toJson()); } - Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async { - hasError = false; - await baseAppClient.post(GET_CHECK_UP_ITEMS, - onSuccess: (dynamic response, int statusCode) { - checkupItemsList.clear(); - response['GetCheckUpItemsList'].forEach((data) { - checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: cMCGetItemsRequestModel.toJson()); + await baseAppClient.post(GET_CHECK_UP_ITEMS, onSuccess: (dynamic response, int statusCode) { + checkupItemsList.clear(); + response['GetCheckUpItemsList'].forEach((data) { + checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: cMCGetItemsRequestModel.toJson()); } Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { - hasError = false; - await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, - onSuccess: (dynamic response, int statusCode) { - isOrderUpdated = true; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: updatePresOrderRequestModel.toJson()); + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); } - Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { - + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { hasError = false; - await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, - onSuccess: (dynamic response, int statusCode) { - isOrderUpdated = true; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: order.toJson()); + String reqId=""; + await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, 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; } } diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index 65fffe33..26f2fe85 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -17,34 +17,28 @@ import '../../../locator.dart'; import 'add_new_address_Request_Model.dart'; class CMCViewModel extends BaseViewModel { - CMCService _cMCService = - locator(); - CustomerAddressesService _customerAddressesService = - locator(); - List get addressesList => - _customerAddressesService.addressesList; - List get cmcAllServicesList => + CMCService _cMCService = locator(); + CustomerAddressesService _customerAddressesService = locator(); - _cMCService.cmcAllServicesList; + List get addressesList => _customerAddressesService.addressesList; - List get cmcAllPresOrders => - _cMCService.cmcAllPresOrdersList; + List get cmcAllServicesList => _cMCService.cmcAllServicesList; - List get cmcAllOrderDetail => - _cMCService.cmcAllOrderDetail; - List get checkupItems => - _cMCService.checkupItemsList; + List get cmcAllPresOrders => _cMCService.cmcAllPresOrdersList; - PharmacyModuleService _pharmacyModuleService = locator(); + List get cmcAllOrderDetail => _cMCService.cmcAllOrderDetail; + + List get checkupItems => _cMCService.checkupItemsList; + + PharmacyModuleService _pharmacyModuleService = locator(); bool get isOrderUpdated => _cMCService.isOrderUpdated; Future getCMCAllServices() async { - await _cMCService - .getCMCAllServices(); + await _cMCService.getCMCAllServices(); CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD); - await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true); + await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel, isFirst: true); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.Error); @@ -52,16 +46,15 @@ class CMCViewModel extends BaseViewModel { setState(ViewState.Idle); } } + Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async { - if(!isFirst) - setState(ViewState.Busy); + if (!isFirst) setState(ViewState.Busy); await _cMCService.getCheckupItems(cMCGetItemsRequestModel); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.Error); } - if(!isFirst) - setState(ViewState.Idle); + if (!isFirst) setState(ViewState.Idle); } Future getCmcAllPresOrders() async { @@ -71,9 +64,7 @@ class CMCViewModel extends BaseViewModel { error = _cMCService.error; setState(ViewState.Error); } else { - var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere( - (element) => element.status == 1 || element.status == 2, - orElse: () => null); + var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere((element) => element.status == 1 || element.status == 2, orElse: () => null); if (pendingOrder != null) { await getOrderDetailByOrderID(pendingOrder); setState(ViewState.Idle); @@ -83,11 +74,9 @@ class CMCViewModel extends BaseViewModel { } } - Future updateCmcPresOrder( - UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { setState(ViewState.BusyLocal); - await _cMCService.updateCmcPresOrder( - updatePresOrderRequestModel); + await _cMCService.updateCmcPresOrder(updatePresOrderRequestModel); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.ErrorLocal); @@ -97,23 +86,24 @@ class CMCViewModel extends BaseViewModel { } Future getOrderDetailByOrderID(GetHHCAllPresOrdersResponseModel order) async { - GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel = - GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD); - await _cMCService - .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); + GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel = GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD); + await _cMCService.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); } + //TODO check it in uat - Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { setState(ViewState.Busy); order.createdBy = user.patientID; order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); - await _cMCService.insertPresPresOrder(order: order); + String requestId = await _cMCService.insertPresPresOrder(order: order); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.ErrorLocal); } else { getCmcAllPresOrders(); } + + return requestId; } Future getCustomerAddresses() async { @@ -129,7 +119,7 @@ class CMCViewModel extends BaseViewModel { Future getCustomerInfo() async { setState(ViewState.Busy); - await _pharmacyModuleService.generatePharmacyToken().then((value) async{ + await _pharmacyModuleService.generatePharmacyToken().then((value) async { await _customerAddressesService.getCustomerInfo(); }); if (_customerAddressesService.hasError) { @@ -140,14 +130,9 @@ class CMCViewModel extends BaseViewModel { } } - Future addAddressInfo( - {AddNewAddressRequestModel addNewAddressRequestModel}) async { - - + Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async { setState(ViewState.Busy); - await _customerAddressesService.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel - ); + await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); if (_customerAddressesService.hasError) { error = _customerAddressesService.error; setState(ViewState.ErrorLocal); @@ -155,4 +140,4 @@ class CMCViewModel extends BaseViewModel { setState(ViewState.Idle); } } -} \ No newline at end of file +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart index 549f90b8..f302f7a2 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart @@ -10,9 +10,7 @@ class ConfirmCancelOrderDialog extends StatefulWidget { final CMCViewModel model; final Function onTap; - - ConfirmCancelOrderDialog( - {Key key, this.model, this.onTap}); + ConfirmCancelOrderDialog({Key key, this.model, this.onTap}); @override _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); @@ -27,11 +25,13 @@ class _ConfirmCancelOrderDialogState extends State { @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, + contentPadding: EdgeInsets.fromLTRB(28.0, 2.0, 28.0, 0.0), + title: Text( + TranslationBase.of(context).confirm, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + letterSpacing: -0.46, ), ), children: [ @@ -39,13 +39,13 @@ class _ConfirmCancelOrderDialogState extends State { children: [ Divider(), Center( - child: Texts( - TranslationBase.of(context).cancelOrderMsg , - color: Colors.grey, + child: Text( + TranslationBase.of(context).cancelOrderMsg, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, letterSpacing: -0.46, color: Colors.grey[600]), ), ), SizedBox( - height: 5.0, + height: 12.0, ), Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -60,9 +60,14 @@ class _ConfirmCancelOrderDialogState extends State { padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + letterSpacing: -0.46, + color: Colors.red, + ), ), ), ), @@ -77,28 +82,32 @@ class _ConfirmCancelOrderDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () async{ + onTap: () async { widget.onTap(); Navigator.pop(context); }, child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + child: Text( + TranslationBase.of(context).ok.toUpperCase(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + letterSpacing: -0.46, + ), + )), ), ), ), ], - ) + ), + SizedBox( + height: 5.0, + ), ], ) ], ); } } - - - diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart new file mode 100644 index 00000000..f7e2ebef --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart @@ -0,0 +1,98 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/theme/colors.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:flutter/material.dart'; +import 'package:progress_hud_v2/generated/i18n.dart'; + +Future showCMCConfirmDialog(BuildContext context, String requestId, {Function onClick}) async { + return showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (BuildContext context) { + return Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ConfirmDialog(requestId,onClick: onClick,), + ], + ), + ); + }, + ); +} + +class ConfirmDialog extends StatelessWidget { + String requestId; + Function onClick; + + ConfirmDialog(this.requestId, {this.onClick}); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + mFlex(1), + IconButton( + icon: Icon( + Icons.close, + ), + onPressed: () { + onClick(); + Navigator.pop(context); + }, + ), + ], + ), + Text( + "Request has been sent successfully. You will be contacted soon.", + textAlign: TextAlign.start, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.46, + ), + ), + mHeight(20), + Text( + "Request ID", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.grey[600], + letterSpacing: -0.46, + ), + ), + Text( + requestId ?? "", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.black, + letterSpacing: -0.46, + ), + ), + mHeight(20), + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: TranslationBase.of(context).ok.toUpperCase(), + color: CustomColors.accentColor, + onTap: () async { + onClick(); + Navigator.pop(context); + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index 5ce0cc3e..27170cab 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; @@ -47,19 +48,14 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { price: widget.model.cmcAllServicesList[0].price, serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), selectedServiceName: widget.model.cmcAllServicesList[0].description, - selectedServiceNameAR: - widget.model.cmcAllServicesList[0].descriptionN, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN, recordID: 1, totalPrice: widget.model.cmcAllServicesList[0].totalPrice, vAT: widget.model.cmcAllServicesList[0].vAT); - cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel( - patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); + cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); } - cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel( - patientERCMCInsertServicesList: patientERCMCInsertServicesList != null - ? [patientERCMCInsertServicesList] - : []); + cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: patientERCMCInsertServicesList != null ? [patientERCMCInsertServicesList] : []); _controller = new PageController(); @@ -89,26 +85,18 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage( - CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { + void showConfirmMessage(CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { showDialog( context: context, child: ConfirmCancelOrderDialog( model: model, onTap: () async { - UpdatePresOrderRequestModel updatePresOrderRequestModel = - UpdatePresOrderRequestModel( - presOrderID: order.presOrderID, - rejectionReason: "", - presOrderStatus: 4, - editedBy: 3); + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3); await model.updateCmcPresOrder(updatePresOrderRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast( - message: - TranslationBase.of(context).processDoneSuccessfully); + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); await model.getCmcAllPresOrders(); } }, @@ -119,282 +107,118 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { body: SafeArea( child: SingleChildScrollView( child: Container( - height: MediaQuery.of(context).size.height * 0.8, - child: Column( - children: [ - - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - widget.model.cmcAllOrderDetail.length != 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( + child: widget.model.cmcAllOrderDetail.length != 0 + ? Column( + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 12, right: 12, top: 12), + child: Card( + shape: cardRadius(12), + elevation: 2, + margin: EdgeInsets.zero, + color: Color(0xffcd9e1b), + clipBehavior: Clip.antiAlias, + child: Container( + // decoration: containerColorRadiusLeft(Colors.white, 12), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), + padding: EdgeInsets.all(12), + // color: Colors.white, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), + topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, + bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), + bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, + ), + ), + // clipBehavior: Clip.antiAlias, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).OrderStatus + + ' ' + + (projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].descriptionN : widget.model.cmcAllOrderDetail[0].description), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + color: Color(0xffcd9e1b), + fontWeight: FontWeight.w700, + ), + ), + mHeight(12), + Text( + TranslationBase.of(context).requestID + ' ' + widget.model.cmcAllOrderDetail[0].iD.toString(), + style: TextStyle( + fontSize: 16, + letterSpacing: -0.48, + fontWeight: FontWeight.w700, + ), + ), + Text( + TranslationBase.of(context).serviceName, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w500, + ), + ), + Text( + !projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].description.toString() : widget.model.cmcAllOrderDetail[0].descriptionN.toString(), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + ), + Column( children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey, width: 1), - borderRadius: - BorderRadius.circular(12), - color: - Theme.of(context).primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, - bottom: 15, - top: 15, - right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Theme.of(context) - .primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context) - .requestID, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - widget.model - .cmcAllOrderDetail[0].iD - .toString(), - fontSize: 22, - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, - bottom: 15, - top: 15, - right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Theme.of(context) - .primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context) - .OrderStatus, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - projectViewModel.isArabic - ? widget - .model - .cmcAllOrderDetail[0] - .descriptionN - : widget - .model - .cmcAllOrderDetail[0] - .description, - fontSize: 22, - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, - bottom: 15, - top: 15, - right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Theme.of(context) - .primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context) - .pickupDate, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate( - widget - .model - .cmcAllOrderDetail[ - 0] - .createdOn)), - fontSize: 22, - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Theme.of(context) - .primaryColor), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context) - .serviceName, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - !projectViewModel.isArabic - ? widget - .model - .cmcAllOrderDetail[0] - .description - .toString() - : widget - .model - .cmcAllOrderDetail[0] - .descriptionN - .toString(), - fontSize: 22, - ), - ], - ), - ), - SizedBox( - height: 12, - ), - Center( - child: Container( - width: MediaQuery.of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: TranslationBase.of( - context) - .cancel - .toUpperCase(), - onTap: () { - showConfirmMessage( - widget.model, - widget.model - .cmcAllOrderDetail[0]); - }, - color: Colors.red[800], - disabled: false, - textColor: Theme.of(context) - .backgroundColor), - ), - ), - SizedBox( - height: 22, - ), - ], + Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w700, ), ), - SizedBox( - height: 22, - ), + mHeight(8), + SecondaryButton( + onTap: () { + showConfirmMessage(widget.model, widget.model.cmcAllOrderDetail[0]); + }, + label: TranslationBase.of(context).cancel, + color: Colors.red[900], + small: true, + ) ], ), - ), - ) - : Container( - color: Colors.red, - child: NewCMCStepOnePage( - changePageViewIndex: changePageViewIndex, - cMCInsertPresOrderRequestModel: - cMCInsertPresOrderRequestModel, - model: widget.model, - ), + ], + ), ), - NewCMCStepTowPage( - longitude: _longitude, - latitude: _latitude, - changePageViewIndex: changePageViewIndex, - cmcInsertPresOrderRequestModel: - cMCInsertPresOrderRequestModel, - model: widget.model, - ), - NewCMCStepThreePage( - changePageViewIndex: changePageViewIndex, - cmcInsertPresOrderRequestModel: - cMCInsertPresOrderRequestModel, - model: widget.model, + ), ), ], + ) + : Container( + color: Colors.red, + child: NewCMCStepOnePage( + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + latitude: _latitude, + longitude: _longitude, + ), ), - ), - ], - ), ), ), ), 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 5bf65ef4..cbbda9b8 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 @@ -14,12 +14,16 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'new_cmc_step_tow_page.dart'; + class NewCMCStepOnePage extends StatefulWidget { final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; final Function changePageViewIndex; final CMCViewModel model; - const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key); + final double latitude; + final double longitude; + const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex,this.latitude,this.longitude}) : super(key: key); @override _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); @@ -178,7 +182,13 @@ class _NewCMCStepOnePageState extends State { if (widget.model.state == ViewState.ErrorLocal) { Utils.showErrorToast(); } else { - widget.changePageViewIndex(1); + navigateTo(context,NewCMCStepTowPage( + longitude: widget.longitude, + latitude: widget.latitude, + cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, + model: widget.model, + )); + // widget.changePageViewIndex(1); } } }, 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 75699a5c..7017122d 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 @@ -2,9 +2,13 @@ import 'dart:async'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/theme/colors.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/others/app_scaffold_widget.dart'; @@ -15,14 +19,9 @@ import 'package:provider/provider.dart'; class NewCMCStepThreePage extends StatefulWidget { final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; - final Function changePageViewIndex; final CMCViewModel model; - NewCMCStepThreePage( - {Key key, - this.changePageViewIndex, - this.model, - this.cmcInsertPresOrderRequestModel}); + NewCMCStepThreePage({Key key, this.model, this.cmcInsertPresOrderRequestModel}); @override _NewCMCStepThreePageState createState() => _NewCMCStepThreePageState(); @@ -44,15 +43,12 @@ class _NewCMCStepThreePageState extends State { markers.add( Marker( markerId: MarkerId( - widget.cmcInsertPresOrderRequestModel.latitude.hashCode - .toString(), + widget.cmcInsertPresOrderRequestModel.latitude.hashCode.toString(), ), - position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, - widget.cmcInsertPresOrderRequestModel.longitude)), + position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude)), ); _kGooglePlex = CameraPosition( - target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, - widget.cmcInsertPresOrderRequestModel.longitude), + target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude), zoom: 14.4746, ); } @@ -63,7 +59,15 @@ class _NewCMCStepThreePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - isShowDecPage: false, + isShowAppBar: true, + description: TranslationBase.of(context).infoCMC, + imagesInfo: [ + ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png'), + ], + appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, baseViewModel: widget.model, body: SingleChildScrollView( physics: BouncingScrollPhysics(), @@ -74,79 +78,93 @@ class _NewCMCStepThreePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - TranslationBase.of(context).orderDetails, - fontWeight: FontWeight.bold, + Text( + TranslationBase.of(context).orderSummary, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + letterSpacing: -0.46, + ), ), SizedBox( height: 12, ), - Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular(12)), - padding: EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).orderLocation + " : ", - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - height: 200, - child: GoogleMap( - mapType: MapType.normal, - markers: markers, - initialCameraPosition: _kGooglePlex, - onMapCreated: (GoogleMapController controller) { - _controller.complete(controller); - }, + Card( + shape: cardRadius(12), + elevation: 4, + child: Container( + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).orderDetails + " : ", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.46, + color: CustomColors.grey, ), ), - ), - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).selectedService), - ...List.generate( - widget.cmcInsertPresOrderRequestModel - .patientERCMCInsertServicesList.length, - (index) => Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).serviceName, - fontSize: 12, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), - Texts( - projectViewModel.isArabic - ? widget - .cmcInsertPresOrderRequestModel - .patientERCMCInsertServicesList[index] - .selectedServiceNameAR - : widget - .cmcInsertPresOrderRequestModel - .patientERCMCInsertServicesList[index] - .selectedServiceName, - fontSize: 15, - bold: true, + SizedBox( + height: 6, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey), + clipBehavior: Clip.antiAlias, + child: Card( + shape: cardRadius(12), + clipBehavior: Clip.antiAlias, + elevation: 0, + margin: const EdgeInsets.all(0), + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, ), - ], + ), + ), + ), + SizedBox( + height: 12, + ), + Text( + TranslationBase.of(context).selectedService, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.46, + color: CustomColors.grey, ), ), - ) - ], + ...List.generate( + widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + projectViewModel.isArabic + ? widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceNameAR + : widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceName, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + letterSpacing: -0.46, + ), + ), + ], + ), + ), + ) + ], + ), ), ) ], @@ -156,18 +174,30 @@ class _NewCMCStepThreePageState extends State { bottomSheet: Container( height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, + color: Colors.white, child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( label: TranslationBase.of(context).confirm, - color: Colors.grey[800], + color: CustomColors.green, onTap: () async { - await widget.model.insertPresPresOrder( - order: widget.cmcInsertPresOrderRequestModel); + String requestId = await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); if (widget.model.state != ViewState.ErrorLocal) { - widget.changePageViewIndex(0); + //show scuccess dialog + showCMCConfirmDialog( + context, + requestId, + onClick: () { + Navigator.pop(context); + Navigator.pop(context); + }, + ); + + } else { + } }, textColor: Theme.of(context).backgroundColor), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 12e1b622..02dbc735 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -1,9 +1,14 @@ +import 'dart:async'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -18,24 +23,16 @@ import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; import 'cmc_location_page.dart'; +import 'new_cmc_step_three_page.dart'; class NewCMCStepTowPage extends StatefulWidget { final Function(PickResult) onPick; final double latitude; final double longitude; final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; - final Function changePageViewIndex; final CMCViewModel model; - const NewCMCStepTowPage( - {Key key, - this.onPick, - this.latitude, - this.longitude, - this.cmcInsertPresOrderRequestModel, - this.changePageViewIndex, - this.model}) - : super(key: key); + const NewCMCStepTowPage({Key key, this.onPick, this.latitude, this.longitude, this.cmcInsertPresOrderRequestModel, this.model}) : super(key: key); @override _NewCMCStepTowPageState createState() => _NewCMCStepTowPageState(); @@ -47,6 +44,14 @@ class _NewCMCStepTowPageState extends State { AddressInfo _selectedAddress; bool showCurrentLocation = false; + Completer _controller = Completer(); + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + + final Set markers = new Set(); + @override void initState() { if (widget.cmcInsertPresOrderRequestModel.latitude == null) { @@ -54,29 +59,43 @@ class _NewCMCStepTowPageState extends State { } else { latitude = widget.cmcInsertPresOrderRequestModel.latitude; longitude = widget.cmcInsertPresOrderRequestModel.longitude; + setMap(); } super.initState(); } - setLatitudeAndLongitude({bool isSetState = false, String latLong}) async { - if (latLong == null){ - if(widget.model.addressesList.isEmpty) { + setMap() { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + latitude.hashCode.toString(), + ), + position: LatLng(latitude, longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(latitude, longitude), + zoom: 14.4746, + ); + } + setLatitudeAndLongitude({bool isSetState = false, String latLong}) async { + if (latLong == null) { + if (widget.model.addressesList.isEmpty) { setState(() { showCurrentLocation = true; }); } else { - latLong = widget - .model.addressesList[widget.model.addressesList.length - 1].latLong; + latLong = widget.model.addressesList[widget.model.addressesList.length - 1].latLong; } - } - if(!showCurrentLocation) { + if (!showCurrentLocation) { List latLongArr = latLong.split(','); latitude = double.parse(latLongArr[0]); longitude = double.parse(latLongArr[1]); + setMap(); } } @@ -84,113 +103,119 @@ class _NewCMCStepTowPageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - isShowDecPage: false, - body: Stack( + isShowAppBar: true, + description: TranslationBase.of(context).infoCMC, + imagesInfo: [ + ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png'), + ], + appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( children: [ - PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - widget.changePageViewIndex(3); - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - Navigator.push( - context, - FadePage( - page: CMCLocationPage( - latitude: latitude, - longitude: longitude, - ), - ), - ); - }, - label: TranslationBase.of(context) - .addNewAddress, - ), - SizedBox( - height: 10, - ), - SecondaryButton( - color: Colors.red[800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.cmcInsertPresOrderRequestModel - .latitude = - selectedPlace.geometry.location.lat; - widget.cmcInsertPresOrderRequestModel - .longitude = - selectedPlace.geometry.location.lng; - }); - widget.changePageViewIndex(3); - }, - label: TranslationBase.of(context).confirm, - ), - ], - )), - ); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: showCurrentLocation, - ), - if(widget.model.addressesList.isNotEmpty) - - Container( - child: InkWell( - onTap: () => - confirmSelectLocationDialog(widget.model.addressesList), + if (widget.model.addressesList.isNotEmpty) + Card( + margin: EdgeInsets.only(left: 12, right: 12, bottom: 12), + shape: cardRadius(12), + elevation: 3, child: Container( - padding: EdgeInsets.all(10), - width: double.infinity, - // height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Theme.of(context).primaryColor), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Texts( - getAddressName(), - fontSize: 14, - ), + child: InkWell( + onTap: () => confirmSelectLocationDialog(widget.model.addressesList), + child: Container( + padding: EdgeInsets.all(8), + width: double.infinity, + // height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + getAddressName(), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.45, + ), + ), + ), + Icon(Icons.arrow_drop_down) + ], ), - Icon(Icons.arrow_drop_down) - ], + ), ), + height: 50, + width: double.infinity, + ), + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: CMCLocationPage( + latitude: latitude, + longitude: longitude, + ), + ), + ); + }, + child: Padding( + padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8), + child: Row( + children: [ + Icon(Icons.add_circle_outline_sharp), + mWidth(12), + Text( + TranslationBase.of(context).addNewAddress, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + ], ), ), - height: 56, - width: double.infinity, - color: Theme.of(context).scaffoldBackgroundColor, - ) + ), + Expanded( + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + zoomControlsEnabled: false, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + Padding( + padding: const EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14), + child: SecondaryButton( + color: Colors.red[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel.latitude = latitude; + widget.cmcInsertPresOrderRequestModel.longitude = longitude; + }); + // widget.changePageViewIndex(3); + navigateTo( + context, + NewCMCStepThreePage( + + cmcInsertPresOrderRequestModel: widget.cmcInsertPresOrderRequestModel, + model: widget.model, + ), + ); + }, + label: TranslationBase.of(context).continues, + ), + ), ], ), ); diff --git a/lib/widgets/dialogs/select_location_dialog.dart b/lib/widgets/dialogs/select_location_dialog.dart index 77916ddc..df33a963 100644 --- a/lib/widgets/dialogs/select_location_dialog.dart +++ b/lib/widgets/dialogs/select_location_dialog.dart @@ -10,8 +10,7 @@ class SelectLocationDialog extends StatefulWidget { final Function(AddressInfo) onValueSelected; AddressInfo selectedAddress; - SelectLocationDialog( - {Key key, this.addresses, this.onValueSelected, this.selectedAddress}); + SelectLocationDialog({Key key, this.addresses, this.onValueSelected, this.selectedAddress}); @override _SelectLocationDialogState createState() => _SelectLocationDialogState(); @@ -27,7 +26,14 @@ class _SelectLocationDialogState extends State { @override Widget build(BuildContext context) { return SimpleDialog( - title: Texts(TranslationBase.of(context).selectAddress), + title: Text( + TranslationBase.of(context).selectAddress, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), children: [ Column( children: [ @@ -39,7 +45,7 @@ class _SelectLocationDialogState extends State { Divider(), ...List.generate( widget.addresses.length, - (index) => Column( + (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( @@ -56,7 +62,13 @@ class _SelectLocationDialogState extends State { }); }, child: ListTile( - title: Text(widget.addresses[index].address1), + title: Text( + widget.addresses[index].address1, + style: TextStyle( + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: widget.addresses[index], groupValue: widget.selectedAddress, @@ -98,9 +110,14 @@ class _SelectLocationDialogState extends State { padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + color: Colors.red, + ), ), ), ), @@ -122,10 +139,14 @@ class _SelectLocationDialogState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + child: Text( + TranslationBase.of(context).ok.toUpperCase(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + )), ), ), ), diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 6fa0a4ec..f5e633ec 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -163,7 +163,7 @@ class _AppDrawerState extends State { } else { projectProvider.changeLanguage('ar'); } - var themeNotifier = Provider.of(context, listen: true); + var themeNotifier = Provider.of(context, listen: false); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); }, ), From d1bc46f451507634767c058e86a22ff7ee53216e Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Tue, 14 Sep 2021 12:27:16 +0300 Subject: [PATCH 5/8] CMC Marge --- .../NewCMC/cmc_location_page.dart | 72 +++---- .../NewCMC/new_cmc_page.dart | 192 +++++++++--------- 2 files changed, 123 insertions(+), 141 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index d7bb61ed..e8b1f2c0 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -1,10 +1,12 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -22,9 +24,7 @@ class CMCLocationPage extends StatefulWidget { final double longitude; final dynamic model; - const CMCLocationPage( - {Key key, this.onPick, this.latitude, this.longitude, this.model}) - : super(key: key); + const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) : super(key: key); @override _CMCLocationPageState createState() => _CMCLocationPageState(); @@ -39,7 +39,7 @@ class _CMCLocationPageState extends State { void initState() { latitude = widget.latitude; longitude = widget.longitude; - if(latitude == 0.0 && longitude == 0.0) { + if (latitude == 0.0 && longitude == 0.0) { showCurrentLocation = true; } super.initState(); @@ -54,6 +54,14 @@ class _CMCLocationPageState extends State { isShowDecPage: false, isShowAppBar: true, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + description: TranslationBase.of(context).infoCMC, + imagesInfo: [ + ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png'), + ], + appBarTitle: TranslationBase.of(context).addNewAddress, body: PlacePicker( apiKey: GOOGLE_API_KEY, enableMyLocationButton: true, @@ -66,10 +74,8 @@ class _CMCLocationPageState extends State { onPlacePicked: (PickResult result) { print(result.adrAddress); }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print( - "state: $state, isSearchBarFocused: $isSearchBarFocused"); + selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); return isSearchBarFocused ? Container() : FloatingCard( @@ -85,67 +91,45 @@ class _CMCLocationPageState extends State { child: Column( children: [ SecondaryButton( - color: Colors.grey[800], + color: CustomColors.accentColor, textColor: Colors.white, onTap: () async { print(selectedPlace); - AddNewAddressRequestModel - addNewAddressRequestModel = - new AddNewAddressRequestModel( + AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( customer: Customer(addresses: [ Addresses( - address1: selectedPlace - .formattedAddress, - address2: selectedPlace - .formattedAddress, + address1: selectedPlace.formattedAddress, + address2: selectedPlace.formattedAddress, customerAttributes: "", city: "", createdOnUtc: "", id: 0, - latLong: - "$latitude,$longitude", + latLong: "$latitude,$longitude", email: "") ]), ); - selectedPlace.addressComponents - .forEach((e) { + selectedPlace.addressComponents.forEach((e) { if (e.types.contains("country")) { - addNewAddressRequestModel - .customer - .addresses[0] - .country = e.longName; + addNewAddressRequestModel.customer.addresses[0].country = e.longName; } - if (e.types - .contains("postal_code")) { - addNewAddressRequestModel - .customer - .addresses[0] - .zipPostalCode = e.longName; + if (e.types.contains("postal_code")) { + addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; } if (e.types.contains("locality")) { - addNewAddressRequestModel - .customer - .addresses[0] - .city = e.longName; + addNewAddressRequestModel.customer.addresses[0].city = e.longName; } }); - await model.addAddressInfo( - addNewAddressRequestModel: - addNewAddressRequestModel); - if (model.state == - ViewState.ErrorLocal) { + await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); + if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast( - message: - "Address Added Successfully"); + AppToast.showSuccessToast(message: "Address Added Successfully"); } Navigator.of(context).pop(); }, - label: TranslationBase.of(context) - .addNewAddress, + label: TranslationBase.of(context).addNewAddress, ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index 27170cab..daee9224 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -105,121 +105,119 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { return Scaffold( body: SafeArea( - child: SingleChildScrollView( - child: Container( - child: widget.model.cmcAllOrderDetail.length != 0 - ? Column( - children: [ - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 12, right: 12, top: 12), - child: Card( - shape: cardRadius(12), - elevation: 2, - margin: EdgeInsets.zero, - color: Color(0xffcd9e1b), - clipBehavior: Clip.antiAlias, - child: Container( - // decoration: containerColorRadiusLeft(Colors.white, 12), - margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), - padding: EdgeInsets.all(12), - // color: Colors.white, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), - topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, - bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), - bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, - ), + child: Container( + child: widget.model.cmcAllOrderDetail.length != 0 + ? Column( + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 12, right: 12, top: 12), + child: Card( + shape: cardRadius(12), + elevation: 2, + margin: EdgeInsets.zero, + color: Color(0xffcd9e1b), + clipBehavior: Clip.antiAlias, + child: Container( + // decoration: containerColorRadiusLeft(Colors.white, 12), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), + padding: EdgeInsets.all(12), + // color: Colors.white, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), + topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, + bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), + bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, ), - // clipBehavior: Clip.antiAlias, - child: Row( - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).OrderStatus + - ' ' + - (projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].descriptionN : widget.model.cmcAllOrderDetail[0].description), - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - color: Color(0xffcd9e1b), - fontWeight: FontWeight.w700, - ), - ), - mHeight(12), - Text( - TranslationBase.of(context).requestID + ' ' + widget.model.cmcAllOrderDetail[0].iD.toString(), - style: TextStyle( - fontSize: 16, - letterSpacing: -0.48, - fontWeight: FontWeight.w700, - ), + ), + // clipBehavior: Clip.antiAlias, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).OrderStatus + + ' ' + + (projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].descriptionN : widget.model.cmcAllOrderDetail[0].description), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + color: Color(0xffcd9e1b), + fontWeight: FontWeight.w700, ), - Text( - TranslationBase.of(context).serviceName, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w500, - ), + ), + mHeight(12), + Text( + TranslationBase.of(context).requestID + ' ' + widget.model.cmcAllOrderDetail[0].iD.toString(), + style: TextStyle( + fontSize: 16, + letterSpacing: -0.48, + fontWeight: FontWeight.w700, ), - Text( - !projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].description.toString() : widget.model.cmcAllOrderDetail[0].descriptionN.toString(), - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w700, - ), + ), + Text( + TranslationBase.of(context).serviceName, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w500, ), - ], - ), - ), - Column( - children: [ + ), Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), + !projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].description.toString() : widget.model.cmcAllOrderDetail[0].descriptionN.toString(), style: TextStyle( fontSize: 12, letterSpacing: -0.48, fontWeight: FontWeight.w700, ), ), - mHeight(8), - SecondaryButton( - onTap: () { - showConfirmMessage(widget.model, widget.model.cmcAllOrderDetail[0]); - }, - label: TranslationBase.of(context).cancel, - color: Colors.red[900], - small: true, - ) ], ), - ], - ), + ), + Column( + children: [ + Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w700, + ), + ), + mHeight(8), + SecondaryButton( + onTap: () { + showConfirmMessage(widget.model, widget.model.cmcAllOrderDetail[0]); + }, + label: TranslationBase.of(context).cancel, + color: Colors.red[900], + small: true, + ) + ], + ), + ], ), ), ), - ], - ) - : Container( - color: Colors.red, - child: NewCMCStepOnePage( - changePageViewIndex: changePageViewIndex, - cMCInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, - model: widget.model, - latitude: _latitude, - longitude: _longitude, ), + ], + ) + : Container( + color: Colors.red, + child: NewCMCStepOnePage( + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + latitude: _latitude, + longitude: _longitude, ), - ), + ), ), ), ); From f795ba24c5f8cba97a8385c674bf81916b5edb0f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 14 Sep 2021 12:31:31 +0300 Subject: [PATCH 6/8] updates & fixes --- assets/images/new-design/NFCIcon_option2.png | Bin 0 -> 11672 bytes lib/config/localized_values.dart | 12 +- lib/core/service/insurance_service.dart | 36 +- .../all_habib_medical_service_page.dart | 20 +- .../health_converter.dart | 124 ++-- .../health_converter/blood_cholesterol.dart | 4 +- .../health_converter/blood_sugar.dart | 62 +- .../health_converter/triglycerides.dart | 2 + .../AlHabibMedicalService/parking_page.dart | 71 +- .../​ health_calculators.dart | 649 +++++++++++------- lib/pages/Blood/blood_donation.dart | 93 +-- lib/pages/Blood/user_agreement_page.dart | 2 + lib/pages/BookAppointment/QRCode.dart | 64 +- lib/pages/BookAppointment/Search.dart | 5 + .../BookAppointment/widgets/DoctorView.dart | 9 +- lib/pages/ToDoList/ToDo.dart | 53 +- lib/pages/landing/landing_page.dart | 23 +- lib/pages/login/confirm-login.dart | 1 + .../my_invoices/invoice_detail_page.dart | 34 +- .../medical/my_invoices/my_invoice_page.dart | 9 +- .../product_detail_service.dart | 2 +- lib/uitl/translations_delegate_base.dart | 12 + lib/widgets/drawer/app_drawer_widget.dart | 2 +- 23 files changed, 697 insertions(+), 592 deletions(-) create mode 100644 assets/images/new-design/NFCIcon_option2.png diff --git a/assets/images/new-design/NFCIcon_option2.png b/assets/images/new-design/NFCIcon_option2.png new file mode 100644 index 0000000000000000000000000000000000000000..938eec27b1220b57864e46276797a922f4c51451 GIT binary patch literal 11672 zcmc(FcRbZ!{Qvu27uU6}l~K5|x2$}!E+u1ctc28(7(&!Z90SO3Tc#d^)7H3ZW5E7ifd z{e1(=LH*Dl_^UJt&goP8dTod{F%+~^JT_CD5MzGTlGebr)cC9&mGHsBE9y|nb$!;| z4SXP2NlrRpFO_X&X7RYl?~TjZ*W=d=v|!~#2r5cL=C3*Gyge_Dvlv3K)3>~ZQ&T}S@oFoT(Y3Y{FRj})ibaNvJj2H zKmL{%bmfC}sHmoCE@r1fwdNWYI&orQTe)b$bFl5$&D$dbQ7R(r%uUtH;wXrV)VMFA zz5eh-Py<<+2+!glgC)r4H(J)J3hJ-g&o~xiikmtw1Imc0X*7p4iRq@u(qW6&kR4+x z4mA1#MF{T7ZoN4=Xre{JQ&iu;Tu5kAVE5taZ%6S0XkIbM#w=&A>fWL;gk~TDZaP&q z#k~@V6f6>wl-UtKoJhoj&u)QTt|PDEkVJ^W<2*a)t?G^D+zgSs6$44*qF;WU5_IJHnh1u$?^}E8lxfm}U&pBXI%r=J zHi_N(S?le&RGpz+KY}`kBcN!W*htG$JWnp@B-40*xqC|C4*4LFKfJW<8Rbr(p@_F* zgfqj4@x5)|xVXBt{%T{3o6z0>?VPDT*<41BBNtewcpt#V>9`tIN#;ym;^qQBbtpAdzRiCllU4^aoer<02XdB z==AYU8qb?ggvk5Eg6j&`Ce*&A-{{9L1p;}=)!n6Hk?Dh%N4$ zLCW{JREWsj#6sxdU7xe$J2~I~Zph|+>s<(oxn9l?sj7=t?h*nJ`MgVWi*Wlj8u9D# zv0!hn&H$-C28+v+I25HRqD1@VZr73(6JcQW7vGF)e+X)2mSVp+cbcGo><8LQ26kP1R+a% zmK2xWB4!7C6x`e{rDLq>&Zin`05ky&<+=t*A6(v*&D(gW%7>zl=ru{m%ROAjvFV_} z^RL0y)PYhd;@g=vfW41K0^fy~9NmubJH+-v4jYFBmJZ2DIuLDQ7$0%`>z!0>Mv7J8 zZfXL)A?QVW1+ESq>`9bK0H}p*Y7DITW)#>|vtM5}T@>_ECs@_*G#!-e5 zkp0NyJoF!R%J)OTTx#gloTT^qRlGFM$D zOviV5eU2iSMoCfUwUFS|S=MWkibM9{g_xAj&z!RXjFI11Alnk<+AeXUMycO=LM#K+ zkH;+1JG$MFZ7_bRS4E2*hpwCbeA&c7*bst#Yi4V#@pRcSaiiRfsD<%e&eElP4D$kL zsG&Z5)iYgU3z)E#!h_4LNe{Gx4^R*%*jWM%$ROnYaBjz|)tnXv9=Gana23^dU`t1Y zz5fORteW`erG?55q$&g(GH^oc!DAB35&z4iuECTBlM^>&dD0NwlymNOpH zb7o<9rsNrl)gn2F_ydQHQ@WA$8V?yzYsY3hWb5u`0v52+YG-gTZb>o}Su6(-ann_Z zN#q5`32zcExN?)*VV#*Sn(HTviAyr?3!;FyWWO6z@tWGU@8-DM0A#I3Sdmo4`h@ec zm)%+4#FrsxChlKz`>%3j%8?43K+1KVqDIWsWx-lH zP{VuqPz-;he+C|I#Q3`%`yKdiu*~bg7B%)}Kbx6egUI%tq7-Ql6dWQ-)gNrauMoPFQ>cMX4*3V_}CnFTCaMvmdC>I zaDy$DQxe@?3unz5N%lj)NHb0_(N^WADQdb51g54OYRp*4+>bK6~-U=n$}V@}A-3MTFv> zK#?PT`);wXW?$A_-bN>Kr$s09gboe zFt^j(4|Z=$2NM)fVWJ8}#v6 zZ2qOE=U@2Hqf*FMEM)tl;Fa<;r!NPxN}oJ1c%E5E6Zj>0rYkK14KHEZYsXwfQ+@GqP_CP&p;b2Fb=#E-`mn zAN(3zOd0qmg+5+pIHMZ3RR4Ke;kVnIl%ZJ!*KS?l3y^hE6a;P5L2nAK$EhI&p7MvU zGrh0;hsg^aw}NxBKX^ZV*rUu|8N=K@-LaAN(e)a<(eKV2OXB>Y?GZ~BaM})vY*-lI z6QP(-#p91@4NlsAKIpr-_r>#a3^UtfG3(rx>FzXEQ)5-#r(D2IPchb8wd3X0(F+D4( zK^k~z%y9P9rqIfI{ozHXHbXml_R(&DJ#D$op#Ddu^o0<$(IEKOzeNUc=n5%q%=i9f zH^$NmCK)v1peGLzg;Z>Zg58xomJh4Vma8&O}94$iumd=tB1MleqnDML##5t zo9jP2Gyv@xmaM+>>`TpNUV)x;3SZ)}r%k*3iK~Gry_Grk=CMj;k3m%S2Ktv`7z@wr ze#)3E&9;3Jt8+23;X^d7XHGWWtnoiYQ|6B3S-uj^mM_^!lrz`5Po1#-Q48mCZ_X}n zjh)`9n-y)^nQNtm(w2<(22oIMvhneL<8!aH$2@Qbl=?DNw9FMnrN=IXCmZ|X)}jur z{)tj|8$L(@5q_RnMjW4b(bFSQ>Sz4s>(^hQ(~e^-Kx)$Q6nP=Dvo03p^3kY zKuu&6is<>i@JEI}#r4@`Qg?Eu<3FGAXka0%d)7tsBsS{dLm~2IGs<*6-NC&yDf~7b zq?d)Ov6ZAd%cI^j!mF^-V8)z=7U0cb8O8AOqiAG(c{$qm_vb-J_9bVQ)5HA0!(j6s z6#1iwu|>=X$!5esAg;bB_1&514Lq1u7kK)K6}H{U$cPeo32xkR;6v3~(qVL>ka|Ib zK8uNNBTcK8wGIqA)+{zG5Vk}y@`*TlLcZ}Zbw|cM&xjxxWFeMA=Aja`}zr%$mmG9IAsb&6|ASCU*T zgxg{KsH?l@x2_DJ8gILN|1ThahY3+&{)>AXd9`cd5Qs|HJ4p<{_(_+hak$71>H zYIj{#k}jsi9J*T|T`EX|8=6;jZNJdRlRZ8ma7NhnS9VyCnOLyw7N5P31F5Zl{{J03 zm_!M5=dX*;!BXr0Tbf+808{d+=`LqtL=wGO!Q?x~8nv?4q%8l>fCLS2<1Y;;({7uH z9md_Xt62aaHf#ns&mTD4LFTe!cH`onnXp70y|iI-2n^QbLuialU71ot={TLBo1id| z;3ETy58CS*g_4qUYvmOfCQNBYRfi~WA;inX2pSSN0fZv z1vDK{rA)gkeSNFXKrA-{rua$;T{?8c8sS-;urn&P7`MOs>&sGJ_cXJO1vu?~ve(yX zb_@EvhTn3{WFlr|G{{fJ;~V=dc`rV;Ph>?dwO%c&L#y%QigHC zVuN)_)t^Fy^7A*69|YSU1R%u$WXN(L=aBfHp&xX-yHIgwjzM@Wzzr`G(Gr0>bDzrU zS>RL503}|-k*rT)Ww;^k@x0}vr~nQ+Dme^r1@Sl=b!gK=j6B1J@GJ$5JfQId&PEG5 zpSZODE-4>m^gwB=SX2ZHbZgo&p>}EDpaFn|IuN)}0;LK;kzVaXumD`LfsOsq$Q>r= zQWuIogar)2B;W=4AVZiQM84qA6HjpHL@h>m&%YnZ=*vigWpv~5e0)#@`x-cO<6M9qwNZ#G&|%=Lu^OOTF&;wTZ0TFj z4G@b$LtLO}q(TI+wZ!6}6L&#C0#3b!&j5zJfDOU2V2S%UJfsp2dJX}1e{_=vng`-m zxrHNNFV5TfC(3Qt^?Q)fa_gn<7( zJKR(9kSY|rsv)_O4tV255yu~)q5K%3d>y@42T}k}Vq)mGFN&(Wi}9;sIJ$;m1!m&V z`kKCNFuTx$?FJ?Q1*|h0@`%XnFGUn62naYj&flJaptfhcsI$8L-Mb=)KURZ28i_!} z2G6mmvw8!APUyPTwWcRgdE9jJ+&>!N)tn7Em>m zcnDR2g5QP;y7jH#tECM<4*OQ-EzU~{YJaBXX-QPG?#}%%ILy**K-a6I7$d?QEL#S9 z>MU|CfvOblf*1-BfWR#uLaJA?EeRq4LRAbxu{8qF1GSXy$}&-kkHD3aKs&_uI4@PG zJtmksx0R{Ectu~E2sDeaG@$r1;y|G78Q}dbk7|mQ0@Nye!J-tH>H9dv3XARb@&lB4 zC3oWh(VG?p*n+)AD_F*|*fM(TgvWo44se7Ak-ganY|LqV-dy88N-#8!n- zuGcf3Aex-ULrW=Fp@&7XDs;TT5Y@S{Pj@xSixisOyyHNbwx>K%p@Uov33KQjMDkqQ zgFsZN&Jm{z-3YS53nBHdv~cGj3Fm;u*3i(E%^>sxKNlgHhwX!3+s|%wqkv^zL_=ou z8Uv;nSzC#*3BRKX8i7l0Sc}aUkf{yqt0?|Qz)etx6lJ$VeADB!2ch^p3i1Z%?p}RH zIpNBOUuRz0%Ap53VI*wjgsDn$K(u~x{F6x!5~@hp(5xJK)yctTrn8t+x6+LUTa*HN zPBET7EH4?G$4{E5Oalgn=0f1hKuNTSjG+#^c`irQ06>ueWy-Wh_i=e7_q8r0Pq!Un zwW*8?bda!6Sfg!?GTi4B%-$7y9Uf&*2kzd`0J5>jYK^lEz83jS2sz1XRPaOQl|C?L ze4`)&hjv+LDML18y0SzqEHs$;*7Z^aHCiK(mpQ&spyXY18l+Su6qkCtHRayAcrv)HSm zFSqY+eDTdc)IkYTNO@iG{N(D}y%1@iD~;X1!`6elsV}d`61nm-(k|c?BgciZq*@+D z%i$h!le(JEFdWqinZ7=;K_N&nKT=M@1hI(j>NA458DLHbUk5m-#A?eHa)MlD%`PV{&aUvsrgV z5P2YX+ZT#pRq97-R}&|_7Ms2!D2RM$kARVRKcgA=hf z?fflw{`jg}>j7acbWOB{7TO6hjn;l;4p?M}S2?B1PO@QaH$uyFoR~`FdJ0yw5L#ES z2)C+lAxg)~sDnyXwwWV?MA8$;xTVA_sUic1;tju<@NedUBaXgkIpV4*{ zkj_QMIjqU~RwCDQ^l5>qgj-k}x8pNXyh8~YG||klz3HvlV&*UpAqA2iWGTEU_XK(! ziI!Q@<3hd+{XBMB=X{cn%c&0phtDj?C0{Z%k)n|406A;?*a<(3vVS|4ENr}$E_itH z$2l(qE?lXPA0Iez(@U`n!80suGdHWaXooO*!zJc*)NY&Mwd7)6@#iV`SbufvSi%Eo(DZdv7tg zrT_D-M0iZ&UM{<>evd5dz%kU%?U2^^t?YIA{Q)_+v14iMsOE67bv(AFAk^&H4^r{x z)%L3uc6te=h8HB^mr$^p2>T1iv*1!D<6`5L1Z+*KUUK|)N6cftz|i~KYo%lhZb-fA zfwN3qpT~#DYiH*QGguHi=foeXy!FtWUcF%}!vTFR>P;rbyBxR&l=R_YueieU6O7IK zIGF!**+XL zSnhPl#+ppZ*Hj%B$;B57osXQJ--uaf#ruIe9e&sYD!Ue6wd3~3>eamdc;mff<2RL; zn9zvHkbqYuVBnksv1Is7bJqL3uB3zE7gPl<#db@Q*3N$qE(i$e9?sPrt=5%3BqJB9 zQ1c!lwSR_lp12D+%Fl-#r-b3RnA9<|xP+k0%=>f0Z}u*K={XuxN0W_QFt$}3es?t5 z3JIB|&LDb(pbJTnOkZsohx{+W3WoSC4heKm>7-|7SGdvz&JFFjBc=kue8k&|`)V6E zcCCwZZKNhG;ajl_aRnW%x30s_`oDvFDcE0q=&jMUawZFYX#FZ-l6Fc0{rD4M-u6~+ zyA}M6v!|g~hn@TwLz?FSNoN1nkZ*pe;+c0=#pla6LmHLDp~n-n%%d7LB+BKfa%OK` zX{-qpe1qzHDYkz}nDENl2EcL7yfC^qX^YvuBFXCKaFrc&(5(}u&DN(${HLTA40SBN zfz^W;9~52Dz(0C|sd1vux%660*~6ZzMee=_sd0B+bfWeL=><*30py(p&leF7$kD~& zc4Rho2e>j4?e?C#ZMH}o^HOGJ;JBgFu=nT2r0I#Bkmg#4;aWlK8L3Vyz^nu zN%uEfa-bV~?#U^0k^U!-Fg7!zk5MP&PRitcq*){X)7x=e4WY2H57x;PBJyV7?FU`5 z5v3l(JL(EU5Jn7KXD(<@i;*A|&L1bs=q1=_U1o2K`!+14gHFSzNXZ`M4iRXwP6`?2 zxNqIN2i0yM+ULqAFH~jBN{ErK+8y-~jwZmae9J|zX|#faQ=hu_e~P1U0wFnLIC!d6 zA@Z0P`lxZ7Wc8e-^NutYIU9*fz__wHkssv=m5t(?p>)5sm5@F zw5t$!;+p+Np`sh|4SyfzecaP$6o7(|ekcq7W68BQd&?n~OsM*Ekv^R+y7Ycvgc9S9t#@r zu3rBp;YP?)=ry0|u)cgLgi~j%wsk_C=R#saM&4`YNDl^yKfoyoc$b|WM|c&1cq)<5 z?JSW%;64kH{9tR0lBC11s+l3>z^L;|?_2(FE^g+XR$bl&C(%t}jl1qAwKN3ILOq)7 zOO@qvctiA%sddEexnP_2ytZ-Q{ERDSo_$g?XFMh6{A)bjSRr!HS@hqPf5+;j~Y6unY7e$0RgDr@)6VfyXVoCe$; zL;XmYXqIT3dlP$#hm)2AH`<{B~#vd67{z_fYaaQPCF=8tGqU{OvQ0jm~W1p>j;SH<`ovjOsYoi%)GIE7kpsoB;J|Fd$Hd^xLRDyi}U%7ofdV>^@ebt ziq7vgziPhd_+2KEL_@SbpW{1NG;h8j@;qVx=?}lqA^SJr;ea0fEx_wWk|we_*Wy8DpeLTZYv+n+v5hb}M zx7JL*-&+c_xrtlAVGAoX9q=fjKE>5xiE9+1g{jACD z~6aFh*CsC-!y8x>rqQ?suW)Nygn4@N*NqrqsO6PkTXelou_*85y-$p&&L(R zyZXfkrylgl#)oyXEX{!1Y^Hi7PBIzJS!XbbcD`+SG`!gS6 z>r%l>-(%;JAieq(TEVX`D!Nql}FrPt$6K^Kb)}XB-_6+z}~sA zFviHVvDoQ0(Gq#s^RdvWet$+Uu`XJ?60L+D`)10ys(0jTPShAyowDg{$>Dfh^Sk_~ zyRf?hwJ`?dO=`~R3nG3prT&%mG2dGceoEJNwrxLoT&62efp+_+nxr<;e{}e7?jnX& zjC>Y=)|>@d;ktfe{c>GZ*});>vSoYC*JrLkJ1*_{e+`26pPM!I{gKuEbcgFfx(Fj&U zXq~F3&;RR74WIdz{+2LQtEuJ@;8!bw`kHvsfHtAKdFV&VKsK4>;#{t_blV3h4Tnw? zlsv8XQC;x`7-SN`+oZY5AU|=JkR@sTW!L18R-$lSF9E!98ECN#?B`u%Bt4#1l&QPR zug)~^5!?$EQjP8O>y&1mQXY!ZDi&B7XFqupwn?0O9g+zAYQZ1*z!60|mZgNsYr35m zr+BwxdeUV%ywbxy(YO$lT-RjF>_mw3Ja+br%x`Oy0oBmT3^m}~&O33+!kyNIL_?vK z4%&vWbO^Jt>|i0BK)JS-4MjgopgCMz-FHTyAmcw(w-ce139Gv&4N_DMs7i2GxaYhj z5*koZ+m!x+g1d84+>4L&sQK~g*ftauvG`$0330V~NAg3&Chru%?MJeU)zlD2ND%oM zC+;?u{HADLS@g=QD?Jh=b2khQ|-9X zbPu9@*?|4uNww@f8uP~;@pDprb_qkdyP7OAP%LZN(F82{j{IKd-FS73Tq+BLs08{! zM^b!T>m9e}1&vQ~pUrTp_7Vx)eMG$-(l7W$KGVHPAwO(+13h!z%UBV;N4y}IALPE0eX?SV@O_0}cfsKvvS|b%SaRg?4OLo!3FP~(wjlu&VDN!R zMVj;xCOFXyg2+m}d!jB|`nNP732?fG9MT(USIIt)>iWf-Palmsi~?^L#6J-dU`<+w ziwPs{+ny-k5bg!1CkL+p+Ve-85DR^$mz2eQ9(e=~6bzuw!;!S0C7Qs}ZGS09qJjh5 z-Whz}BVcr(j|z9l;-`T^ecV$(jzJ0(kM#u zXWMu^C;~Hp$0>ACEGewCjenKG8-e?Jik9DIfeMcl8C6w$d0 zdLtoYG^Y&OhB4sZ=zPy5Z;^q;_3WoRp0|K@sHyXVgpXv;_Pan1bMS4k{M9UVd_|wja<^W)d+hAJt?h5Y8}y4K zm?W$;7VSDBbyPDlWW#!zUPRa6EvcsYRvpcLrka?{t8Aet878ZxQ_&*6kv;sUV(RS(0W}6?F7@l>|(2XB7mZp@TRo- zmKb;q21gxPI;RLWe(SBoK+7PC=7OoXSn%|Vmb$@1M;=Z`?I<<$RZ1NA#`m@6WZE$nTylPWqm#a2K|R~LGNi7B*IS)QK2YyfW24m zN+9&>ryp*IMRwij^n4sfBBXt=u76JW`B@}qs|vN-v$q1#-zWB)cspb6z;+Se-sCe=-U!+y`!9p4uChJm8q0(QksmRRt*UK@_?ep_71G zNF@od4xa)XLwD#>_X3X-Aqc#g1a<>>{~s7S+uSW0qa)PvD}nj<;6j+IY1%He68Y0m z@_(3)|8+t9{~>@b-o~++mzz|Cf!0(Y^5-uNl!WPu_ { Navigator.push( context, FadePage( - page: MedicalProfilePage(), + page: MedicalProfilePageNew(), ), ); }, @@ -197,9 +199,7 @@ class _AllHabibMedicalServiceState extends State { onTap: () => Navigator.push( context, FadePage( - page: BookingOptions( - isAppbar: true, - ), + page: Search(), ), ), imageLocation: 'assets/images/new-design/booking_icon_active.png', @@ -230,7 +230,7 @@ class _AllHabibMedicalServiceState extends State { context, FadePage(page: CovidDrivethruLocation()), ), - imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: 'assets/images/covid-car.png', title: TranslationBase.of(context).covid19_driveThrueTest, ), ServicesContainer( @@ -276,7 +276,7 @@ class _AllHabibMedicalServiceState extends State { page: MyFamily(), ), ), - imageLocation: 'assets/images/new-design/family_menu_icon_red.png', + imageLocation: 'assets/images/new-design/family_icon_bottom_bar.png', title: TranslationBase.of(context).myFamily, ), if (projectViewModel.havePrivilege(35)) @@ -296,14 +296,6 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - // if (projectViewModel.havePrivilege(42)) - // ServicesContainer( - // onTap: () => Navigator.push( - // context, - // FadePage(page: SymptomInfo()), - // ), - // imageLocation: 'assets/images/new-design/body_icon.png', - // title: TranslationBase.of(context).symptomCheckerTitle), if (projectViewModel.havePrivilege(36)) ServicesContainer( onTap: () => Navigator.push( diff --git a/lib/pages/AlHabibMedicalService/health_converter.dart b/lib/pages/AlHabibMedicalService/health_converter.dart index 5ae80183..27c2a05c 100644 --- a/lib/pages/AlHabibMedicalService/health_converter.dart +++ b/lib/pages/AlHabibMedicalService/health_converter.dart @@ -16,9 +16,13 @@ class HealthConverter extends StatefulWidget { class _HealthConverterState extends State { @override Widget build(BuildContext context) { + List myMedicalList = myOptionsList(context); + return AppScaffold( isShowAppBar: true, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).converters, body: Column( children: [ @@ -26,72 +30,66 @@ class _HealthConverterState extends State { width: double.infinity, height: 30, ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage(page: BloodSugar()), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).bloodSugar, - imagePath: 'blood_sugar_icon.png', - subTitle: TranslationBase.of(context).sugar, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: BloodCholesterol(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).bloodCholesterol, - imagePath: 'blood_cholesterol_icon.png', - subTitle: TranslationBase.of(context).cholesterol, - ), - ), - ), - ], + Padding( + padding: EdgeInsets.only(left: 12, right: 12), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + return myMedicalList[index]; + }, + ), ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: Triglycerides(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).triglycerides, - imagePath: 'triglycerides_blood_icon.png', - subTitle: TranslationBase.of(context).fatInBlood, - ), - ), - ), - Expanded( - flex: 1, - child: Container(), - ), - ], - ) ], ), ); } + + List myOptionsList(BuildContext context) { + List medical = List(); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: BloodSugar()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).bloodSugar, + imagePath: 'assets/images/new-design/blood_sugar_icon.png', + subTitle: TranslationBase.of(context).sugar, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: BloodCholesterol()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).bloodCholesterol, + imagePath: 'assets/images/new-design/blood_cholesterol_icon.png', + subTitle: TranslationBase.of(context).cholesterol, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: Triglycerides()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).triglycerides, + imagePath: 'assets/images/new-design/triglycerides_blood_icon.png', + subTitle: TranslationBase.of(context).fatInBlood, + isPngImage: true, + ), + )); + return medical; + } } diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index ac31b98c..1b25f443 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/services.dart'; -const activeCardColor = Color(0xff70777A); +const activeCardColor = Color(0xffD02127); const inactiveCardColor = Color(0xffFAFAFd); class BloodCholesterol extends StatefulWidget { @@ -65,6 +65,8 @@ class _BloodCholesterolState extends State { isShowAppBar: true, appBarTitle: TranslationBase.of(context).bloodCholesterol, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, body: Padding( padding: const EdgeInsets.all(16.0), child: SingleChildScrollView( diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index e9369b82..ebc41150 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -1,13 +1,12 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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:flutter/services.dart'; -const activeCardColor = Color(0xff515a5d); +const activeCardColor = Color(0xffD02127); const activeTextColor = Color(0xffFAFAFA); const inactiveCardColor = Color(0xffFAFAFA); const inactiveTextColor = Color(0xff60686B); @@ -81,6 +80,8 @@ class _BloodSugarState extends State { return AppScaffold( isShowAppBar: true, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).bloodSugarConversion, body: Container( padding: const EdgeInsets.all(16.0), @@ -89,13 +90,11 @@ class _BloodSugarState extends State { Expanded( child: SingleChildScrollView( child: Column( - //crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), child: Text( TranslationBase.of(context).convertBloodSugarStatement, - //textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0), ), ), @@ -105,13 +104,11 @@ class _BloodSugarState extends State { Container( color: Colors.white, child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 16.0, horizontal: 8), + padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8), child: Column( children: [ Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Row( children: [ Texts( @@ -144,19 +141,16 @@ class _BloodSugarState extends State { boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.5), - spreadRadius: 3, + spreadRadius: 1, blurRadius: 7, - offset: Offset(0, - 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: cardMGColor, - borderRadius: - BorderRadius.circular(3.0), + borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), child: Texts( 'MG/DLt TO \nMMOL/L', color: textMGColor, @@ -180,21 +174,18 @@ class _BloodSugarState extends State { height: 65.0, decoration: BoxDecoration( color: cardMMOLColor, - borderRadius: - BorderRadius.circular(3.0), + borderRadius: BorderRadius.circular(3.0), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset(0, - 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Texts( 'MMOL/L TO MG/DLt ', color: textMMOLColor, @@ -229,8 +220,7 @@ class _BloodSugarState extends State { ], keyboardType: TextInputType.number, decoration: InputDecoration( - labelText: - TranslationBase.of(context).enterReadingValue, + labelText: TranslationBase.of(context).enterReadingValue, enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.white), ), @@ -240,8 +230,7 @@ class _BloodSugarState extends State { focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.white), ), - border: UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), + border: UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)), labelStyle: TextStyle( color: Colors.black87, ), @@ -275,8 +264,7 @@ class _BloodSugarState extends State { style: TextStyle(fontSize: 35.0), ), Padding( - padding: - EdgeInsets.only(left: 4.0, top: 10.0), + padding: EdgeInsets.only(left: 4.0, top: 10.0), child: Text( unit.toString(), style: TextStyle( @@ -299,18 +287,12 @@ class _BloodSugarState extends State { ), Container( margin: EdgeInsets.symmetric(horizontal: 16), - child: SecondaryButton( - label: TranslationBase.of(context).calculate, - color: Color(0XFF515A5D), - onTap: () { - setState(() { - _visible == false - ? _visible = !_visible - : _visible = _visible; - calculateBloodSugar(); - }); - }, - ), + child: DefaultButton(TranslationBase.of(context).calculate, () { + setState(() { + _visible == false ? _visible = !_visible : _visible = _visible; + calculateBloodSugar(); + }); + }), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart index 7c821055..35184f7b 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart @@ -67,6 +67,8 @@ class _TriglyceridesState extends State { isShowAppBar: true, appBarTitle: TranslationBase.of(context).triglycerides, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, body: Padding( padding: const EdgeInsets.all(16.0), child: SingleChildScrollView( diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart index f3620917..864beb98 100644 --- a/lib/pages/AlHabibMedicalService/parking_page.dart +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -1,16 +1,16 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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:maps_launcher/maps_launcher.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:provider/provider.dart'; + import '../../d_q_icons_icons.dart'; class ParkingPage extends StatelessWidget { @@ -21,11 +21,11 @@ class ParkingPage extends StatelessWidget { onModelReady: (model) => model.getIsSaveParking(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).parking, description: TranslationBase.of(context).parkingDescription, - imagesInfo: [ - ImagesInfo(imageAr: 'assets/images/bc_parking.png', imageEn: 'assets/images/bc_parking.png', isAsset: true) - ], + imagesInfo: [ImagesInfo(imageAr: 'assets/images/bc_parking.png', imageEn: 'assets/images/bc_parking.png', isAsset: true)], body: SingleChildScrollView( padding: EdgeInsets.all(12), child: !model.isSavePark @@ -61,10 +61,7 @@ class ParkingPage extends StatelessWidget { child: Container( height: 150, padding: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -86,16 +83,13 @@ class ParkingPage extends StatelessWidget { Container( padding: EdgeInsets.all(8), width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), height: 70, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).showMyPark), - Texts(projectViewModel.isArabic - ? model.qrParkingModel.floorDescriptionN - : model.qrParkingModel.floorDescription), + Texts(projectViewModel.isArabic ? model.qrParkingModel.floorDescriptionN : model.qrParkingModel.floorDescription), ], ), ), @@ -103,8 +97,7 @@ class ParkingPage extends StatelessWidget { height: 15, ), Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), padding: EdgeInsets.all(8), width: double.infinity, height: 70, @@ -112,9 +105,7 @@ class ParkingPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).gate), - Texts(projectViewModel.isArabic - ? model.qrParkingModel.gateDescriptionN - : model.qrParkingModel.gateDescription), + Texts(projectViewModel.isArabic ? model.qrParkingModel.gateDescriptionN : model.qrParkingModel.gateDescription), ], ), ), @@ -122,8 +113,7 @@ class ParkingPage extends StatelessWidget { height: 15, ), Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), padding: EdgeInsets.all(8), width: double.infinity, height: 70, @@ -131,9 +121,7 @@ class ParkingPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).building), - Texts(projectViewModel.isArabic - ? model.qrParkingModel.buildingDescriptionN - : model.qrParkingModel.buildingDescription), + Texts(projectViewModel.isArabic ? model.qrParkingModel.buildingDescriptionN : model.qrParkingModel.buildingDescription), ], ), ), @@ -142,17 +130,14 @@ class ParkingPage extends StatelessWidget { ), Container( padding: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), width: double.infinity, height: 70, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).branch), - Texts(projectViewModel.isArabic - ? model.qrParkingModel.branchDescriptionN - : model.qrParkingModel.branchDescription), + Texts(projectViewModel.isArabic ? model.qrParkingModel.branchDescriptionN : model.qrParkingModel.branchDescription), ], ), ), @@ -170,13 +155,7 @@ class ParkingPage extends StatelessWidget { children: [ Container( width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - onTap: () async { - model.readQr(); - }, - label: TranslationBase.of(context).readBarcode, - loading: model.state == ViewState.BusyLocal, - textColor: Theme.of(context).backgroundColor), + child: DefaultButton(TranslationBase.of(context).readBarcode, () => {model.readQr()}), ), ], ), @@ -189,16 +168,14 @@ class ParkingPage extends StatelessWidget { children: [ Container( width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - onTap: () async { - MapsLauncher.launchCoordinates( - model.qrParkingModel.latitude, - model.qrParkingModel.longitude, - ); - }, - disabled: model.qrParkingModel.longitude == 0, - label: TranslationBase.of(context).showMyPark, - textColor: Theme.of(context).backgroundColor), + child: DefaultButton( + TranslationBase.of(context).showMyPark, + () => { + MapsLauncher.launchCoordinates( + model.qrParkingModel.latitude, + model.qrParkingModel.longitude, + ), + }), ), SizedBox( height: 12, diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index fab4eb6d..6df44279 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -1,17 +1,17 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:provider/provider.dart'; + import 'health_calculator/bmi_calculator/bmi_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart'; -import 'health_calculator/calorie_calculator/calorie_calculator.dart'; import 'health_calculator/delivery_due/delivery_due.dart'; import 'health_calculator/ideal_body/ideal_body.dart'; @@ -22,6 +22,7 @@ class HealthCalculators extends StatefulWidget { class _HealthCalculatorsState extends State with SingleTickerProviderStateMixin { TabController _tabController; + void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); @@ -34,249 +35,427 @@ class _HealthCalculatorsState extends State with SingleTicker @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + List generalHealthList = getGeneralHealthList(context); + List womenHealthList = getWomenHealthList(context); + return AppScaffold( isShowAppBar: true, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).calculators, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(70.0), - child: Stack( - children: [ - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 1.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 5.7, - ), - ), - color: Colors.white, - ), - child: Center( - child: TabBar( - controller: _tabController, - isScrollable: true, - indicatorWeight: 4.0, - indicatorColor: Colors.red, - labelColor: Theme.of(context).buttonColor, - labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), - unselectedLabelColor: Colors.grey, - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: Texts(TranslationBase.of(context).generalHealth), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: Texts(TranslationBase.of(context).womanHealth), - ), - ), - ], - ), - ), + body: Column( + children: [ + TabBar( + controller: _tabController, + isScrollable: true, + indicatorWeight: 4.0, + indicatorColor: Colors.red, + labelColor: Theme.of(context).buttonColor, + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + unselectedLabelColor: Colors.grey, + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Text(TranslationBase.of(context).generalHealth), ), - ) + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Text(TranslationBase.of(context).womanHealth), + ), + ), ], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - Container( - child: Column( - children: [ - Container( - width: double.infinity, - height: 80, + Expanded( + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + controller: _tabController, + children: [ + Container( + margin: EdgeInsets.all(20.0), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12, right: 12), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: generalHealthList.length, + itemBuilder: (BuildContext context, int index) { + return generalHealthList[index]; + }, ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage(page: BMICalculator()), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).bmi, - imagePath: 'bmi_health_calculator.png', - subTitle: TranslationBase.of(context).calcHealth, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: CalorieCalculator(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).calories, - imagePath: 'calories-calculator.png', - subTitle: TranslationBase.of(context).calcHealth, - ), - ), - ), - ], - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: BmrCalculator(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).bmr, - imagePath: 'BMR_calculator.png', - subTitle: TranslationBase.of(context).calcHealth, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: IdealBody(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).idealBody, - imagePath: 'body_weight.png', - subTitle: TranslationBase.of(context).weight, - ), - ), - ), - ], - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: BodyFat(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).bodyWord, - imagePath: 'body_fat.png', - subTitle: TranslationBase.of(context).fat, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: Carbs(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).carbohydrate, - imagePath: 'carb_protein.png', - subTitle: TranslationBase.of(context).proteinFat, - ), - ), - ), - ], - ), - ], - ), + ), + ], ), - Container( - child: Column( - children: [ - Container( - width: double.infinity, - height: 80, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage(page: OvulationPeriod()), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).ovulation, - imagePath: 'ovulation_period_icon.png', - subTitle: TranslationBase.of(context).period, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DeliveryDue(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).delivery, - imagePath: 'delivery_date_icon.png', - subTitle: TranslationBase.of(context).dueDate, - ), - ), - ), - ], + ), + Container( + margin: EdgeInsets.all(20.0), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12, right: 12), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: womenHealthList.length, + itemBuilder: (BuildContext context, int index) { + return womenHealthList[index]; + }, ), - ], - ), + ), + ], ), - ], - ), - ) - ], - ), + ), + ], + ), + ), + ], ), + + // Scaffold( + // extendBodyBehindAppBar: true, + // appBar: PreferredSize( + // preferredSize: Size.fromHeight(70.0), + // child: Column( + // children: [ + // Center( + // child: Container( + // height: 60.0, + // margin: EdgeInsets.only(top: 10.0), + // width: MediaQuery.of(context).size.width * 1.9, + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: Theme.of(context).dividerColor, + // width: 5.7, + // ), + // ), + // color: Colors.white, + // ), + // child: Center( + // child: TabBar( + // controller: _tabController, + // isScrollable: true, + // indicatorWeight: 4.0, + // indicatorColor: Colors.red, + // labelColor: Theme.of(context).buttonColor, + // labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + // unselectedLabelColor: Colors.grey, + // tabs: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.35, + // child: Center( + // child: Texts(TranslationBase.of(context).generalHealth), + // ), + // ), + // Container( + // width: MediaQuery.of(context).size.width * 0.35, + // child: Center( + // child: Texts(TranslationBase.of(context).womanHealth), + // ), + // ), + // ], + // ), + // ), + // ), + // ) + // ], + // ), + // ), + // body: Column( + // children: [ + // Expanded( + // child: TabBarView( + // physics: BouncingScrollPhysics(), + // controller: _tabController, + // children: [ + // Container( + // child: Column( + // children: [ + // Container( + // width: double.infinity, + // height: 80, + // ), + // Row( + // children: [ + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage(page: BMICalculator()), + // ); + // }, + // child: MedicalProfileItem( + // title: TranslationBase.of(context).bmi, + // imagePath: 'bmi_health_calculator.png', + // subTitle: TranslationBase.of(context).calcHealth, + // ), + // ), + // ), + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: CalorieCalculator(), + // ), + // ); + // }, + // child: MedicalProfileItem( + // title: TranslationBase.of(context).calories, + // imagePath: 'calories-calculator.png', + // subTitle: TranslationBase.of(context).calcHealth, + // ), + // ), + // ), + // ], + // ), + // Row( + // children: [ + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: BmrCalculator(), + // ), + // ); + // }, + // child: MedicalProfileItem( + // title: TranslationBase.of(context).bmr, + // imagePath: 'BMR_calculator.png', + // subTitle: TranslationBase.of(context).calcHealth, + // ), + // ), + // ), + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: IdealBody(), + // ), + // ); + // }, + // child: MedicalProfileItem( + // title: TranslationBase.of(context).idealBody, + // imagePath: 'body_weight.png', + // subTitle: TranslationBase.of(context).weight, + // ), + // ), + // ), + // ], + // ), + // Row( + // children: [ + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: BodyFat(), + // ), + // ); + // }, + // child: MedicalProfileItem( + // title: TranslationBase.of(context).bodyWord, + // imagePath: 'body_fat.png', + // subTitle: TranslationBase.of(context).fat, + // ), + // ), + // ), + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: Carbs(), + // ), + // ); + // }, + // child: MedicalProfileItem( + // title: TranslationBase.of(context).carbohydrate, + // imagePath: 'carb_protein.png', + // subTitle: TranslationBase.of(context).proteinFat, + // ), + // ), + // ), + // ], + // ), + // ], + // ), + // ), + // Container( + // child: Column( + // children: [ + // Padding( + // padding: EdgeInsets.only(left: 12, right: 12), + // child: GridView.builder( + // shrinkWrap: true, + // primary: false, + // physics: NeverScrollableScrollPhysics(), + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + // padding: EdgeInsets.zero, + // itemCount: womenHealthList.length, + // itemBuilder: (BuildContext context, int index) { + // return womenHealthList[index]; + // }, + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ) + // ], + // ), ); } + + List getGeneralHealthList(BuildContext context) { + List medical = List(); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: BMICalculator()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).bmi, + imagePath: 'assets/images/new-design/bmi_health_calculator.png', + subTitle: TranslationBase.of(context).calcHealth, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: CalorieCalculator()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).calories, + imagePath: 'assets/images/new-design/ovulation_period_icon.png', + subTitle: TranslationBase.of(context).calcHealth, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: BmrCalculator()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).bmr, + imagePath: 'assets/images/new-design/ovulation_period_icon.png', + subTitle: TranslationBase.of(context).calcHealth, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: IdealBody()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).idealBody, + imagePath: 'assets/images/new-design/ovulation_period_icon.png', + subTitle: TranslationBase.of(context).weight, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: BodyFat()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).bodyWord, + imagePath: 'assets/images/new-design/ovulation_period_icon.png', + subTitle: TranslationBase.of(context).fat, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: Carbs()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).carbohydrate, + imagePath: 'assets/images/new-design/ovulation_period_icon.png', + subTitle: TranslationBase.of(context).proteinFat, + isPngImage: true, + ), + )); + + return medical; + } + + List getWomenHealthList(BuildContext context) { + List medical = List(); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: OvulationPeriod()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).ovulation, + imagePath: 'assets/images/new-design/ovulation_period_icon.png', + subTitle: TranslationBase.of(context).period, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: DeliveryDue()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).delivery, + imagePath: 'assets/images/new-design/delivery_date_icon.png', + subTitle: TranslationBase.of(context).dueDate, + isPngImage: true, + ), + )); + + return medical; + } } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index f362c2bc..63567eff 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -17,7 +17,7 @@ import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisD import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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'; @@ -83,6 +83,8 @@ class _BloodDonationPageState extends State { onModelReady: (model) => model.getCities(), //model.getHospitals(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, baseViewModel: model, imagesInfo: imagesInfo, description: TranslationBase.of(context).bloodDonationInfo, @@ -108,10 +110,10 @@ class _BloodDonationPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getHospitalName(projectProvider, context)), Icon(Icons.arrow_drop_down)], + children: [Texts(getHospitalName(projectProvider, context), color: Colors.black), Icon(Icons.arrow_drop_down)], ), ), ), @@ -121,17 +123,15 @@ class _BloodDonationPageState extends State { InkWell( //======Gender======== onTap: () => confirmSelectGenderDialog(), - //confirmSelectBeneficiaryDialog(model), child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - //Texts(getBeneficiaryType()), - Texts(getGender(context)), + Texts(getGender(context), color: Colors.black), Icon(Icons.arrow_drop_down) ], ), @@ -143,19 +143,14 @@ class _BloodDonationPageState extends State { InkWell( //======Gender======== onTap: () => confirmSelectBloodDialog(), - //confirmSelectBeneficiaryDialog(model), child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - //Texts(getBeneficiaryType()), - Texts(getBlood()), - Icon(Icons.arrow_drop_down) - ], + children: [Texts(getBlood(), color: Colors.black), Icon(Icons.arrow_drop_down)], ), ), ), @@ -163,12 +158,13 @@ class _BloodDonationPageState extends State { height: 12, ), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Text(TranslationBase.of(context).viewTermsConditions), - ), - SizedBox( - width: MediaQuery.of(context).size.height * 0.10, + child: Text( + TranslationBase.of(context).viewTermsConditions + ":", + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), + ), ), InkWell( onTap: () { @@ -178,6 +174,7 @@ class _BloodDonationPageState extends State { child: Texts( TranslationBase.of(context).clickHere, color: Colors.blue, + fontSize: 14.0, ), ), ) @@ -194,22 +191,12 @@ class _BloodDonationPageState extends State { checkedValue = value; }); }, - // tristate: checkedValue==true,//i == 1, value: checkedValue, - activeColor: Color(0xFFc5272d), //Color(0xFF6200EE), - ), - SizedBox( - height: 10, - ), - Row( - children: [], - ), - SizedBox( - width: 10, + activeColor: Color(0xFFc5272d), ), Text( TranslationBase.of(context).iAgreeToTheTermsAndConditions, - style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue ? Color(0xFFc5272d) : Colors.black), + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), ), ], ), @@ -239,7 +226,7 @@ class _BloodDonationPageState extends State { onlyCancelButton: true, )); }, - child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png')), + child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white), ), ), ), @@ -253,41 +240,27 @@ class _BloodDonationPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Color(0xFFa0a4a6) - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: TranslationBase.of(context).save, - onTap: () async { - if (_selectedHospital == null) { - AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); - return; - } - bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; - bloodDetails.cityCode = _selectedHospital.iD.toString(); - bloodDetails.gender = gender == Gender.Male ? 1 : 2; - await model.updateBloodGroup(bloodDetails); - if (model.state == ViewState.Idle) { - AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); - } else { - AppToast.showErrorToast(message: model.error); - } - }, - ), + child: DefaultButton(TranslationBase.of(context).save, () async { + if (_selectedHospital == null) { + AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); + return; + } + bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; + bloodDetails.cityCode = _selectedHospital.iD.toString(); + bloodDetails.gender = gender == Gender.Male ? 1 : 2; + await model.updateBloodGroup(bloodDetails); + if (model.state == ViewState.Idle) { + AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); + } else { + AppToast.showErrorToast(message: model.error); + } + }), )), ); } - //============== void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { showDialog( context: context, diff --git a/lib/pages/Blood/user_agreement_page.dart b/lib/pages/Blood/user_agreement_page.dart index 36989ea5..319d868e 100644 --- a/lib/pages/Blood/user_agreement_page.dart +++ b/lib/pages/Blood/user_agreement_page.dart @@ -12,6 +12,8 @@ class UserAgreementPage extends StatelessWidget { onModelReady: (model) => model.getUserTermsAndConditions(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + showNewAppBarTitle: true, + showNewAppBar: true, appBarTitle: TranslationBase.of(context).userAgreement, body: SingleChildScrollView( child: Html( diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 97cda171..3c3c1402 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -12,6 +12,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/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -43,7 +44,6 @@ class _QRCodeState extends State { widget.authUser = new AuthenticatedUser(); NFC.isNDEFSupported.then((supported) { setState(() { - print("nfc supprted"); _supportsNFC = true; }); }); @@ -56,6 +56,8 @@ class _QRCodeState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).attendRegisterCode, isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, body: SingleChildScrollView( child: Container( child: Column( @@ -146,7 +148,7 @@ class _QRCodeState extends State { child: Text(TranslationBase.of(context).appoInfo, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), ), Container( - margin: EdgeInsets.only(left: 20.0, bottom: 20.0), + margin: EdgeInsets.only(left: 20.0, bottom: 20.0, right: 20.0), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.grey[200], @@ -161,10 +163,11 @@ class _QRCodeState extends State { margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), ), - Container( - margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0), - child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), + if (getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality) != "null\n") + Container( + margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0), + child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), + ), Container( margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), @@ -177,57 +180,12 @@ class _QRCodeState extends State { ), ), Container( - margin: EdgeInsets.zero, + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0), alignment: Alignment.bottomCenter, 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: () { -// navigateToQR(context); -// getAppoQR(context); - sendEmail(); - }, - child: Text(TranslationBase.of(context).sendEmail.toUpperCase(), style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.1, - margin: EdgeInsets.only(bottom: 20.0), - 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: () { - navigateToHome(context); - }, - child: Text(TranslationBase.of(context).close.toUpperCase(), style: TextStyle(fontSize: 18.0)), - ), - ), + DefaultButton(TranslationBase.of(context).sendEmail.toUpperCase(), () => {sendEmail()}) ], ), ), diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 497d5388..e44cb108 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,10 +1,12 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.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:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'components/SearchByClinic.dart'; @@ -31,6 +33,7 @@ class _SearchState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { AppGlobal.context = context; + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: false, isShowDecPage: false, @@ -46,11 +49,13 @@ class _SearchState extends State with TickerProviderStateMixin { 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, diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 4ab3f1ca..f909ce53 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -53,11 +53,10 @@ class DoctorView extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (doctor.doctorTitle != null) - Text( - doctor.doctorTitle + " " + doctor.name, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), + Text( + doctor.name, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), if (doctor.doctorTitle != null) SizedBox(height: 6), Row( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 749ff667..5519562d 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -26,6 +26,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -114,12 +115,13 @@ class _ToDoState extends State { children: [ Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0), Container( + width: MediaQuery.of(context).size.width * 0.4, margin: EdgeInsets.only(left: 10.0, right: 10.0), child: Text( DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + " " + - widget.appoList[index].startTime.substring(0, 5), + widget.appoList[index].startTime.substring(0, 5), overflow: TextOverflow.clip, style: TextStyle(fontSize: 10.0)), ), !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(), @@ -161,11 +163,12 @@ class _ToDoState extends State { children: [ Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: 1.0)), - 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)), - ), + 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)), + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, @@ -189,7 +192,7 @@ class _ToDoState extends State { widgetBuilder: (_, CurrentRemainingTime time) { return time != null ? Text( - '${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' + + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' + TranslationBase.of(context).upcomingTimeLeft, style: TextStyle(fontSize: 12.0, color: Color(0xff40ACC9))) : Container(); @@ -229,7 +232,7 @@ class _ToDoState extends State { Expanded( flex: 2, child: Container( - child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 12.0, color: Colors.grey[700])), + child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])), ), ), Expanded( @@ -240,7 +243,7 @@ class _ToDoState extends State { }, child: Container( child: Text(TranslationBase.of(context).upcomingDetails, - textAlign: TextAlign.end, style: TextStyle(fontSize: 12.0, color: new Color(0xFF40ACC9), decoration: TextDecoration.underline)), + textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xFF40ACC9), decoration: TextDecoration.underline)), ), ), ) @@ -264,10 +267,23 @@ class _ToDoState extends State { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/video.png") : Image.asset("assets/images/new-design/walkin.png"), - widget.appoList[index].isLiveCareAppointment - ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0)) - : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0)) + widget.appoList[index].clinicID == 265 + ? Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: SvgPicture.asset( + "assets/images/new/car_icon.svg", + height: 15, + width: 15, + ), + ) + : widget.appoList[index].isLiveCareAppointment + ? Image.asset("assets/images/new-design/video.png") + : Image.asset("assets/images/new-design/walkin.png"), + widget.appoList[index].clinicID == 265 + ? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0)) + : widget.appoList[index].isLiveCareAppointment + ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0)) + : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0)) ], ), ), @@ -304,7 +320,7 @@ class _ToDoState extends State { break; case 30: - return "assets/images/new-design/qr_code_button.png"; + return "assets/images/new-design/NFCIcon_option2.png"; break; case 40: @@ -320,7 +336,7 @@ class _ToDoState extends State { break; case 90: - return "assets/images/new-design/check-in.png"; + return "assets/images/new-design/NFCIcon_option2.png"; break; default: @@ -410,7 +426,11 @@ class _ToDoState extends State { break; case 30: - return TranslationBase.of(context).upcomingQR; + return TranslationBase.of(context).upcomingQRNFC; + break; + + case 90: + return TranslationBase.of(context).upcomingQRNFC; break; case 40: @@ -549,7 +569,6 @@ class _ToDoState extends State { DoctorsListService service = new DoctorsListService(); service.generateAppointmentQR(patientShareResponse, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res); navigateToQR(context, res['AppointmentQR'], patientShareResponse); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 89856974..00efc157 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel. import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; @@ -22,9 +21,7 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; -import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; -import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; @@ -33,6 +30,7 @@ import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.da import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -41,7 +39,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + import '../../locator.dart'; import '../../routes.dart'; @@ -252,10 +250,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.getToken().then((String token) { print("Firebase Token: " + token); sharedPref.setString(PUSH_TOKEN, token); - if (token != null && DEVICE_TOKEN == "") { + if (token != null) { DEVICE_TOKEN = token; checkUserStatus(token); - if (projectViewModel.isLogin) this.getNotificationCount(DEVICE_TOKEN); + // if (projectViewModel.isLogin) this.getNotificationCount(DEVICE_TOKEN); } }); if (results[Permission.location].isGranted) {} @@ -491,16 +489,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (await sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - // authService - // .registeredAuthenticatedUser(data, token, 0, 0) - // .then((res) => {print(res)}); authService.getDashboard().then((value) => { if (value != null) { setState(() { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) } @@ -665,18 +659,19 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); - if (projectViewModel.isLoading == true) { + if (authenticatedUserObject.isLogin) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); authService.getDashboard().then((value) => { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); } - }) + }), }); } - } + } else {} } } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index a4f9f0b0..bfb5a85a 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -572,6 +572,7 @@ class _ConfirmLogin extends State { authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { print(err); }); + // authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); } getToDoCount() { diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 618c5676..23f3ba6a 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -54,10 +54,10 @@ class InvoiceDetail extends StatelessWidget { child: Table( children: [ TableRow(children: [ - Text("Description", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - Text("Quantity", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - Text("Price", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - Text("Total", textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text(TranslationBase.of(context).description, textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text(TranslationBase.of(context).quantity, textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text(TranslationBase.of(context).price, textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text(TranslationBase.of(context).total, textAlign: TextAlign.center, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), ]), ], ), @@ -82,7 +82,7 @@ class InvoiceDetail extends StatelessWidget { ), Container( child: AppExpandableNotifier( - title: "Total Price: " + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].grandTotal.toString() + " SAR", + title: TranslationBase.of(context).patientShareTotal.toString() + " " + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].grandTotal.toString() + " SAR", isExpand: true, bodyWidget: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Table( @@ -90,45 +90,45 @@ class InvoiceDetail extends StatelessWidget { TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Discount: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).discount, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].discountAmount.toString() + " SAR", + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].discountAmount.toString() + " " + TranslationBase.of(context).sar, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), ]), TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("VAT (" + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() + "%)", + child: Text(TranslationBase.of(context).totalVAT.toString() + " (" + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() + "%): ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].patientVATAmount.toString() + " SAR", + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].patientVATAmount.toString() + " " + TranslationBase.of(context).sar, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), ]), TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Total: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).total.toString() + ": ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].totalPatientShare.toString() + " SAR", + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].totalPatientShare.toString() + " " + TranslationBase.of(context).sar, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), ]), TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Paid: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).paid.toString() + ": ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0, bottom: 10.0), - child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].totalPatientShare.toString() + " SAR", + child: Text(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].totalPatientShare.toString() + " " + TranslationBase.of(context).sar, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), ]), @@ -152,7 +152,7 @@ class InvoiceDetail extends StatelessWidget { TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Insurance: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).dentalInsurance + ": ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0, bottom: 5.0), @@ -162,7 +162,7 @@ class InvoiceDetail extends StatelessWidget { TableRow(children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Insurance ID: ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).insuranceID + ": ", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 10.0, bottom: 10.0), @@ -221,11 +221,11 @@ class InvoiceDetail extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(lab.price.toString() + " SAR", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), + child: Text(lab.price.toString() + " " + TranslationBase.of(context).sar, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(lab.total.toString() + " SAR", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), + child: Text(lab.total.toString() + " " + TranslationBase.of(context).sar, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w400)), ), ]), ); diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index c634a587..db4436b7 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -96,7 +96,7 @@ class _MyInvoicesState extends State { children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Appointment No: ", + child: Text(TranslationBase.of(context).appointmentNo + ": ", style: TextStyle( fontSize: 14.0, color: Colors.black, @@ -104,7 +104,7 @@ class _MyInvoicesState extends State { ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Appointment Date: ", + child: Text(TranslationBase.of(context).appointmentDate + ": ", style: TextStyle( fontSize: 14.0, color: Colors.black, @@ -113,7 +113,7 @@ class _MyInvoicesState extends State { Container( margin: EdgeInsets.only( top: 10.0, bottom: 10.0), - child: Text("Clinic: ", + child: Text(TranslationBase.of(context).clinic + ": ", style: TextStyle( fontSize: 14.0, color: Colors.black, @@ -203,14 +203,13 @@ class _MyInvoicesState extends State { DoctorListResponse.DoctorList doctor = new DoctorListResponse.DoctorList(); - doctor.name = listDentalAppointments.doctorName; + doctor.name = projectViewModel.isArabic ? listDentalAppointments.doctorNameN : listDentalAppointments.doctorName; doctor.projectName = listDentalAppointments.projectName; doctor.date = listDentalAppointments.appointmentDate; doctor.actualDoctorRate = 0; doctor.doctorImageURL = listDentalAppointments.doctorImageURL; doctor.projectID = listDentalAppointments.projectID; doctor.dayName = listDentalAppointments.invoiceNo; - doctor.doctorTitle = "Dr."; doctor.clinicName = "InvoiceNo: " + listDentalAppointments.invoiceNo.toString(); myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, context).then((res) { diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index f85faf2c..e219adaa 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -138,7 +138,7 @@ class ProductDetailService extends BaseService { Future getWishlistItems() async { var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); hasError = false; - await baseAppClient.getPharmacy(GET_WISHLIST+customerId+"?shopping_cart_type=2", + await baseAppClient.getPharmacy(GET_WISHLIST.toString()+customerId.toString()+"?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) { _wishListProducts.clear(); response['shopping_carts'].forEach((item) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 474b13cd..512a8be1 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2203,6 +2203,18 @@ class TranslationBase { String get offlineClinics => localizedValues["offline-clinics"][locale.languageCode]; String get clinicSchedule => localizedValues["clinic-schedule"][locale.languageCode]; + + String get discount => localizedValues["discount"][locale.languageCode]; + + String get totalVAT => localizedValues["total-VAT"][locale.languageCode]; + + String get paid => localizedValues["paid"][locale.languageCode]; + + String get dentalInsurance => localizedValues["dental-insurance"][locale.languageCode]; + + String get drivethruAppo => localizedValues["drivethru-appo"][locale.languageCode]; + + String get upcomingQRNFC => localizedValues["upcoming-QR-NFC"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 6fa0a4ec..f5e633ec 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -163,7 +163,7 @@ class _AppDrawerState extends State { } else { projectProvider.changeLanguage('ar'); } - var themeNotifier = Provider.of(context, listen: true); + var themeNotifier = Provider.of(context, listen: false); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); }, ), From 2d38e8905bb34ccfa09493cb8528d8e4cd77cd4f Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Tue, 14 Sep 2021 16:34:45 +0300 Subject: [PATCH 7/8] CMC 1.4 --- .../NewCMC/new_cmc_step_three_page.dart | 38 +++++-- .../NewCMC/new_cmc_step_tow_page.dart | 102 +++++++++++++----- 2 files changed, 100 insertions(+), 40 deletions(-) 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 7017122d..77291083 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 @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_v import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; import 'package:diplomaticquarterapp/theme/colors.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/secondary_button.dart'; @@ -78,6 +79,9 @@ class _NewCMCStepThreePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 12, + ), Text( TranslationBase.of(context).orderSummary, style: TextStyle( @@ -120,13 +124,26 @@ class _NewCMCStepThreePageState extends State { clipBehavior: Clip.antiAlias, elevation: 0, margin: const EdgeInsets.all(0), - child: GoogleMap( - mapType: MapType.normal, - markers: markers, - initialCameraPosition: _kGooglePlex, - onMapCreated: (GoogleMapController controller) { - _controller.complete(controller); - }, + // child: GoogleMap( + // mapType: MapType.normal, + // markers: markers, + // initialCameraPosition: _kGooglePlex, + // onMapCreated: (GoogleMapController controller) { + // _controller.complete(controller); + // }, + // ), + child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" + + widget.cmcInsertPresOrderRequestModel.latitude.toString() + + "," + + widget.cmcInsertPresOrderRequestModel.longitude.toString() + + "&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" + + widget.cmcInsertPresOrderRequestModel.latitude.toString() + + "," + + widget.cmcInsertPresOrderRequestModel.longitude.toString() + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", + width: double.infinity, + height: double.infinity, + fit: BoxFit.cover, ), ), ), @@ -184,7 +201,9 @@ class _NewCMCStepThreePageState extends State { label: TranslationBase.of(context).confirm, color: CustomColors.green, onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); String requestId = await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); + GifLoaderDialogUtils.hideDialog(context); if (widget.model.state != ViewState.ErrorLocal) { //show scuccess dialog showCMCConfirmDialog( @@ -195,10 +214,7 @@ class _NewCMCStepThreePageState extends State { Navigator.pop(context); }, ); - - } else { - - } + } else {} }, textColor: Theme.of(context).backgroundColor), ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 02dbc735..316a9ab9 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -18,8 +18,10 @@ 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:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'cmc_location_page.dart'; @@ -45,38 +47,63 @@ class _NewCMCStepTowPageState extends State { bool showCurrentLocation = false; Completer _controller = Completer(); + GoogleMapController googleMapController; static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), zoom: 14.4746, ); - final Set markers = new Set(); + LatLng currentPostion; - @override - void initState() { - if (widget.cmcInsertPresOrderRequestModel.latitude == null) { - setLatitudeAndLongitude(); - } else { - latitude = widget.cmcInsertPresOrderRequestModel.latitude; - longitude = widget.cmcInsertPresOrderRequestModel.longitude; + void _getUserLocation() async { + if (await Permission.contacts.request().isGranted) { + // Either the permission was already granted before or the user just granted it. + var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.high); + + currentPostion = LatLng(position.latitude, position.longitude); setMap(); + } else { + requestPermissions().then((value) async { + if (value[Permission.location].isGranted) { + var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.high); + + currentPostion = LatLng(position.latitude, position.longitude); + setMap(); + } + }); } + } + + @override + void initState() { + _getUserLocation(); super.initState(); } setMap() { - markers.clear(); - markers.add( - Marker( - markerId: MarkerId( - latitude.hashCode.toString(), + setState(() { + _kGooglePlex = CameraPosition( + target: currentPostion, + zoom: 14.4746, + ); + googleMapController.animateCamera( + CameraUpdate.newCameraPosition( + CameraPosition( + target: currentPostion, + zoom: 20, ), - position: LatLng(latitude, longitude)), - ); - _kGooglePlex = CameraPosition( - target: LatLng(latitude, longitude), - zoom: 14.4746, - ); + ), + ); + }); + } + + Future> requestPermissions() async { + var permissionResults = [ + Permission.location, + Permission.locationAlways, + ].request(); + + return permissionResults; } setLatitudeAndLongitude({bool isSetState = false, String latLong}) async { @@ -116,7 +143,7 @@ class _NewCMCStepTowPageState extends State { children: [ if (widget.model.addressesList.isNotEmpty) Card( - margin: EdgeInsets.only(left: 12, right: 12, bottom: 12), + margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12), shape: cardRadius(12), elevation: 3, child: Container( @@ -183,14 +210,27 @@ class _NewCMCStepTowPageState extends State { ), ), Expanded( - child: GoogleMap( - mapType: MapType.normal, - markers: markers, - zoomControlsEnabled: false, - initialCameraPosition: _kGooglePlex, - onMapCreated: (GoogleMapController controller) { - _controller.complete(controller); - }, + child: Stack( + alignment: Alignment.center, + children: [ + GoogleMap( + mapType: MapType.normal, + zoomControlsEnabled: false, + myLocationButtonEnabled: true, + myLocationEnabled: true, + initialCameraPosition: _kGooglePlex, + onCameraMove: ((_position) => _updatePosition(_position)), + onMapCreated: (GoogleMapController controller) { + googleMapController = controller; + _controller.complete(controller); + }, + ), + Icon( + Icons.place, + color: CustomColors.accentColor, + size: 50, + ), + ], ), ), Padding( @@ -207,7 +247,6 @@ class _NewCMCStepTowPageState extends State { navigateTo( context, NewCMCStepThreePage( - cmcInsertPresOrderRequestModel: widget.cmcInsertPresOrderRequestModel, model: widget.model, ), @@ -221,6 +260,11 @@ class _NewCMCStepTowPageState extends State { ); } + void _updatePosition(CameraPosition _position) { + latitude = _position.target.latitude; + longitude = _position.target.longitude; + } + void confirmSelectLocationDialog(List addresses) { showDialog( context: context, From 2d7c7239c551dae49ae4628ba780f1c85546e0d7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 14 Sep 2021 16:43:59 +0300 Subject: [PATCH 8/8] Health Converters fixes --- lib/config/localized_values.dart | 14 ++ .../health-calculator/bariatrics-service.dart | 27 ++- .../NewCMC/new_cmc_step_three_page.dart | 1 - .../delivery_due/delivery_due.dart | 23 +- .../delivery_due_result_page.dart | 117 +++++++--- .../ovulation_period/ovulation_period.dart | 25 +- .../ovulation_result_page.dart | 89 ++++++- .../​ health_calculators.dart | 221 +----------------- lib/pages/BookAppointment/SearchResults.dart | 2 +- .../appointment_services/GetDoctorsList.dart | 2 +- lib/uitl/translations_delegate_base.dart | 30 +++ 11 files changed, 264 insertions(+), 287 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfd3cb12..e838e589 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1473,4 +1473,18 @@ const Map localizedValues = { "dental-insurance": { "en": "Insurance", "ar": "التأمين" }, "drivethru-appo": { "en": "Drive Thru Appointment", "ar": "موعد من داخل السيارة" }, "upcoming-QR-NFC": { "en": "Use the NFC or QR Code to Check-In", "ar": "استخدم NFC أو رمزQR لتسجيل الوصول" }, + "ovulation-desc": { "en": "Calculates Ovulation Period", "ar": "حساب افضل فترة للحمل بناءاً على تاريخ اخر دورة شهرية" }, + "cycle-label": { "en": "Average Cycle Length (usually 28 days):", "ar": "متوسط الدورة الشهرية 28 يوم : " }, + "luteal-label": { "en": "Average Luteal Phase Length (usually 14 days):", "ar": "متوسط الأيام ما بعد الاباضة عادة 14 يوما : " }, + "pregnancy-title": { "en": "Delivery Due Date", "ar": "تاريخ الولادة" }, + "pregnancy-desc": { "en": "Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual period began (the first day), then click calculate.", "ar": "مبروك, أنت حامل! الآن متى سيصل الطفل؟ لتقدير موعد الولادة, ادخل تاريخ بداية آخر دورة شهرية (اليوم الأول), ثم اضغط على الحساب" }, + "pregnancy-date-label": { "en": "What was the date of the first day of the last period?", "ar": "ما هو تاريخ أول يوم من أخر دورة شهرية ؟" }, + "ovulation-period": { "en": "The next ovulation period is estimated to be: ", "ar": "تقدر فترة الاباضة القادمة " }, + "from": { "en": "From: ", "ar": "من:" }, + "to": { "en": "To: ", "ar": "الى:" }, + "conceive": { "en": "You have conceived on: ", "ar": " تاريخ بداية الحمل" }, + "firstTri": { "en": "First Trimester Ends (12 weeks):", "ar": "تاريخ انتهاء الثلث الأول 12 اسبوع: " }, + "secondTri": { "en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: " }, + "thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" }, + "seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" } }; diff --git a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart index 4b38ef65..c952a88f 100644 --- a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart +++ b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart @@ -3,9 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_time_model.dart'; -import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_time_request_model.dart'; import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart'; -import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:flutter/cupertino.dart'; @@ -69,8 +67,7 @@ class BariatricsService extends BaseService { body['Longitude'] = 0; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(SEARCH_DOCTOR_BY_TIME, onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { + await baseAppClient.post(SEARCH_DOCTOR_BY_TIME, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); @@ -92,8 +89,7 @@ class BariatricsService extends BaseService { body['PatientID'] = 0; body['isDentalAllowedBackend'] = false; - if(disease != null) - body['DiseaseID'] = disease.diseasesID; + if (disease != null) body['DiseaseID'] = disease.diseasesID; await baseAppClient.post(GET_DOCTOR_LIST_BY_TIME, onSuccess: (dynamic response, int statusCode) { doctorListByTime.clear(); @@ -106,4 +102,23 @@ class BariatricsService extends BaseService { super.error = error; }, body: body); } + + Future getCalculationDoctors({@required int calculationID}) async { + hasError = false; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + + Map body = Map(); + body['CalculationID'] = calculationID; // hint: it is static depend on IONIC project + body['LanguageID'] = languageID == 'ar' ? 1 : 2; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_LIST_CALCULATION, onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return Future.value(localRes); + } } 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 7017122d..4cbf9423 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 @@ -195,7 +195,6 @@ class _NewCMCStepThreePageState extends State { Navigator.pop(context); }, ); - } else { } diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart index db5a585c..1ada0ca1 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -1,6 +1,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -40,16 +40,18 @@ class _DeliveryDueState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Delivery Due Date', + showNewAppBar: true, + showNewAppBarTitle: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).pregnancyTitle, body: Padding( padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), child: SingleChildScrollView( child: Container( child: Column( - //mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Texts( - 'Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual perios began (the first day), then click calculate.', + TranslationBase.of(context).pregnancyDesc, ), Divider( //height: 2, @@ -58,7 +60,7 @@ class _DeliveryDueState extends State { Column( children: [ Texts( - 'What was the date of the first day of the last period?', + TranslationBase.of(context).pregnancyDateLabel, ), InkWell( onTap: () { @@ -86,6 +88,7 @@ class _DeliveryDueState extends State { }, child: Container( padding: EdgeInsets.all(12), + margin: EdgeInsets.only(top: 15.0), width: double.infinity, height: 65, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), @@ -95,7 +98,7 @@ class _DeliveryDueState extends State { Row( children: [ Icon(Icons.date_range), - Texts('Date'), + Texts(TranslationBase.of(context).date), ], ), Texts(getDate()), @@ -111,9 +114,9 @@ class _DeliveryDueState extends State { Container( height: 50.0, width: 350.0, - child: SecondaryButton( - label: 'CALCULATE', - onTap: () { + child: DefaultButton( + TranslationBase.of(context).calculate, + () { setState(() { { Navigator.push( diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart index e03e5fce..b546426b 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart @@ -1,5 +1,9 @@ -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.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/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -14,19 +18,17 @@ class DeliveryDueResult extends StatelessWidget { var firstTrimester; var secondTrimester; var thirdTrimester; - DeliveryDueResult( - {this.dateFrom, - this.dateTo, - this.conceivedDate, - this.deliveryDue, - this.firstTrimester, - this.secondTrimester, - this.thirdTrimester}); + + DeliveryDueResult({this.dateFrom, this.dateTo, this.conceivedDate, this.deliveryDue, this.firstTrimester, this.secondTrimester, this.thirdTrimester}); + @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Delivery Due Date', + showNewAppBar: true, + showNewAppBarTitle: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).pregnancyTitle, body: Padding( padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), child: SingleChildScrollView( @@ -37,23 +39,21 @@ class DeliveryDueResult extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Texts( - 'The next ovulation period is estimated to be:', + TranslationBase.of(context).ovulationPeriod, fontWeight: FontWeight.w400, ), Texts( - 'From:', + TranslationBase.of(context).from, fontWeight: FontWeight.w400, ), - Texts(DateFormat.yMMMEd().format(dateFrom), - fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), + Texts(DateFormat.yMMMEd().format(dateFrom), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), Texts( - 'To:', + TranslationBase.of(context).to, fontWeight: FontWeight.w400, ), - Texts(DateFormat.yMMMEd().format(dateTo), - fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), + Texts(DateFormat.yMMMEd().format(dateTo), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), Texts( - 'You have conceived on:', + TranslationBase.of(context).conceive, fontWeight: FontWeight.w400, ), Texts( @@ -62,7 +62,7 @@ class DeliveryDueResult extends StatelessWidget { fontSize: 21.0, ), Texts( - 'First Trimester Ends (12 weeks):', + TranslationBase.of(context).firstTri, fontWeight: FontWeight.w400, ), Texts( @@ -71,7 +71,7 @@ class DeliveryDueResult extends StatelessWidget { fontSize: 21.0, ), Texts( - 'Second Trimester Ends (27 weeks):', + TranslationBase.of(context).secondTri, fontWeight: FontWeight.w400, ), Texts( @@ -80,7 +80,7 @@ class DeliveryDueResult extends StatelessWidget { fontSize: 21.0, ), Texts( - 'Third Trimester, Estimated Due Date (40 weeks):', + TranslationBase.of(context).thirdTri, fontWeight: FontWeight.w400, ), Texts( @@ -90,13 +90,10 @@ class DeliveryDueResult extends StatelessWidget { ), Container( width: 350, - child: Button( - label: 'See List Of Doctors', - onTap: () { - Navigator.push( - context, - FadePage(page: DoctorList()), - ); + child: DefaultButton( + TranslationBase.of(context).seeDoctorsList, + () { + getDoctorsList(context); }, ), ), @@ -107,4 +104,66 @@ class DeliveryDueResult extends StatelessWidget { ), ); } + + getDoctorsList(BuildContext context) { + GifLoaderDialogUtils.showMyDialog(context); + BariatricsService service = new BariatricsService(); + + List doctorsList = []; + List _patientDoctorAppointmentListHospital = List(); + + service.getCalculationDoctors(calculationID: 6).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['List_CalculationTable'].length); + if (res['MessageStatus'] == 1) { + if (res['List_CalculationTable'].length != 0) { + res['List_CalculationTable'].forEach((item) { + DoctorList docList = new DoctorList(); + docList.clinicID = item['ClinicID']; + docList.clinicName = item['ClinicName']; + docList.doctorID = item['DoctorID']; + docList.doctorImageURL = item['DoctorImageURL']; + docList.name = item['DoctorName']; + docList.doctorTitle = item['DoctorTitle']; + docList.gender = item['Gender']; + docList.genderDescription = item['GenderDescription']; + docList.nationalityName = item['Nationality']; + docList.nationalityFlagURL = item['NationalityFlagURL']; + docList.projectID = item['ProjectID']; + docList.projectName = item['ProjectName']; + docList.actualDoctorRate = 0; + doctorsList.add(docList); + }); + + doctorsList.forEach((element) { + List doctorByHospital = _patientDoctorAppointmentListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); + } else { + _patientDoctorAppointmentListHospital + .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); + } + }); + + Navigator.push( + context, + FadePage( + page: SearchResults( + isLiveCareAppointment: false, + doctorsList: doctorsList, + patientDoctorAppointmentListHospital: + _patientDoctorAppointmentListHospital))); + + } + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } } diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart index a6e490a8..99c7505d 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.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/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -41,10 +43,6 @@ class _OvulationPeriodState extends State { return "${DateUtil.getMonth(selectedDateTime.month)} ${selectedDateTime.day}, ${selectedDateTime.year}"; } - // void calculate() {} - // - // void calculateFertility(DateTime selectedDate) {const diff = Date.} - calculateBabyInformation() { setState(() { bloodSugarDate = selectedDateTime; @@ -64,7 +62,10 @@ class _OvulationPeriodState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Ovulation Period', + showNewAppBar: true, + showNewAppBarTitle: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).ovulation, body: Padding( padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), child: SingleChildScrollView( @@ -73,7 +74,7 @@ class _OvulationPeriodState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Calculates Ovulation Period'), + Texts(TranslationBase.of(context).ovulationDesc), SizedBox( height: 12.0, ), @@ -108,7 +109,7 @@ class _OvulationPeriodState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('Date'), + Texts(TranslationBase.of(context).date), Texts(getDate()), ], ), @@ -118,7 +119,7 @@ class _OvulationPeriodState extends State { height: 5.0, ), Texts( - 'Average Cycle Length (usually 28 days):', + TranslationBase.of(context).cycleLabel, fontWeight: FontWeight.w400, ), SizedBox( @@ -218,7 +219,7 @@ class _OvulationPeriodState extends State { ], ), Texts( - 'Average Luteal Phase Length (usually 14 days):', + TranslationBase.of(context).lutealLabel, fontWeight: FontWeight.w400, ), SizedBox( @@ -323,9 +324,9 @@ class _OvulationPeriodState extends State { Container( height: 50.0, width: 350.0, - child: SecondaryButton( - label: 'CALCULATE', - onTap: () { + child: DefaultButton( + TranslationBase.of(context).calculate, + () { calculateBabyInformation(); Navigator.push( context, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart index 53ccb664..c512f181 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart @@ -1,5 +1,10 @@ -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.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/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -27,8 +32,10 @@ class OvulationResult extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( - isShowAppBar: true, - appBarTitle: 'Ovulation Period', + showNewAppBar: true, + showNewAppBarTitle: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).ovulation, body: Padding( padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), child: SingleChildScrollView( @@ -78,7 +85,7 @@ class OvulationResult extends StatelessWidget { fontWeight: FontWeight.w400, ), Texts( - babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks," + "3", + babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks", fontWeight: FontWeight.w800, fontSize: 21.0, ), @@ -93,13 +100,10 @@ class OvulationResult extends StatelessWidget { ), Container( width: 350, - child: Button( - label: 'See List Of Doctors', - onTap: () { - Navigator.push( - context, - FadePage(page: DoctorList()), - ); + child: DefaultButton( + TranslationBase.of(context).seeDoctorsList, + () { + getDoctorsList(context); }, ), ), @@ -110,4 +114,67 @@ class OvulationResult extends StatelessWidget { ), ); } + + getDoctorsList(BuildContext context) { + GifLoaderDialogUtils.showMyDialog(context); + BariatricsService service = new BariatricsService(); + + List doctorsList = []; + List _patientDoctorAppointmentListHospital = List(); + + service.getCalculationDoctors(calculationID: 6).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['List_CalculationTable'].length); + if (res['MessageStatus'] == 1) { + if (res['List_CalculationTable'].length != 0) { + res['List_CalculationTable'].forEach((item) { + DoctorList docList = new DoctorList(); + docList.clinicID = item['ClinicID']; + docList.clinicName = item['ClinicName']; + docList.doctorID = item['DoctorID']; + docList.doctorImageURL = item['DoctorImageURL']; + docList.name = item['DoctorName']; + docList.doctorTitle = item['DoctorTitle']; + docList.gender = item['Gender']; + docList.genderDescription = item['GenderDescription']; + docList.nationalityName = item['Nationality']; + docList.nationalityFlagURL = item['NationalityFlagURL']; + docList.projectID = item['ProjectID']; + docList.projectName = item['ProjectName']; + docList.actualDoctorRate = 0; + doctorsList.add(docList); + }); + + doctorsList.forEach((element) { + List doctorByHospital = _patientDoctorAppointmentListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); + } else { + _patientDoctorAppointmentListHospital + .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); + } + }); + + Navigator.push( + context, + FadePage( + page: SearchResults( + isLiveCareAppointment: false, + doctorsList: doctorsList, + patientDoctorAppointmentListHospital: + _patientDoctorAppointmentListHospital))); + + } + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + } diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index 6df44279..5dce5b15 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -129,217 +129,6 @@ class _HealthCalculatorsState extends State with SingleTicker ), ], ), - - // Scaffold( - // extendBodyBehindAppBar: true, - // appBar: PreferredSize( - // preferredSize: Size.fromHeight(70.0), - // child: Column( - // children: [ - // Center( - // child: Container( - // height: 60.0, - // margin: EdgeInsets.only(top: 10.0), - // width: MediaQuery.of(context).size.width * 1.9, - // decoration: BoxDecoration( - // border: Border( - // bottom: BorderSide( - // color: Theme.of(context).dividerColor, - // width: 5.7, - // ), - // ), - // color: Colors.white, - // ), - // child: Center( - // child: TabBar( - // controller: _tabController, - // isScrollable: true, - // indicatorWeight: 4.0, - // indicatorColor: Colors.red, - // labelColor: Theme.of(context).buttonColor, - // labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), - // unselectedLabelColor: Colors.grey, - // tabs: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.35, - // child: Center( - // child: Texts(TranslationBase.of(context).generalHealth), - // ), - // ), - // Container( - // width: MediaQuery.of(context).size.width * 0.35, - // child: Center( - // child: Texts(TranslationBase.of(context).womanHealth), - // ), - // ), - // ], - // ), - // ), - // ), - // ) - // ], - // ), - // ), - // body: Column( - // children: [ - // Expanded( - // child: TabBarView( - // physics: BouncingScrollPhysics(), - // controller: _tabController, - // children: [ - // Container( - // child: Column( - // children: [ - // Container( - // width: double.infinity, - // height: 80, - // ), - // Row( - // children: [ - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage(page: BMICalculator()), - // ); - // }, - // child: MedicalProfileItem( - // title: TranslationBase.of(context).bmi, - // imagePath: 'bmi_health_calculator.png', - // subTitle: TranslationBase.of(context).calcHealth, - // ), - // ), - // ), - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: CalorieCalculator(), - // ), - // ); - // }, - // child: MedicalProfileItem( - // title: TranslationBase.of(context).calories, - // imagePath: 'calories-calculator.png', - // subTitle: TranslationBase.of(context).calcHealth, - // ), - // ), - // ), - // ], - // ), - // Row( - // children: [ - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: BmrCalculator(), - // ), - // ); - // }, - // child: MedicalProfileItem( - // title: TranslationBase.of(context).bmr, - // imagePath: 'BMR_calculator.png', - // subTitle: TranslationBase.of(context).calcHealth, - // ), - // ), - // ), - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: IdealBody(), - // ), - // ); - // }, - // child: MedicalProfileItem( - // title: TranslationBase.of(context).idealBody, - // imagePath: 'body_weight.png', - // subTitle: TranslationBase.of(context).weight, - // ), - // ), - // ), - // ], - // ), - // Row( - // children: [ - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: BodyFat(), - // ), - // ); - // }, - // child: MedicalProfileItem( - // title: TranslationBase.of(context).bodyWord, - // imagePath: 'body_fat.png', - // subTitle: TranslationBase.of(context).fat, - // ), - // ), - // ), - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: Carbs(), - // ), - // ); - // }, - // child: MedicalProfileItem( - // title: TranslationBase.of(context).carbohydrate, - // imagePath: 'carb_protein.png', - // subTitle: TranslationBase.of(context).proteinFat, - // ), - // ), - // ), - // ], - // ), - // ], - // ), - // ), - // Container( - // child: Column( - // children: [ - // Padding( - // padding: EdgeInsets.only(left: 12, right: 12), - // child: GridView.builder( - // shrinkWrap: true, - // primary: false, - // physics: NeverScrollableScrollPhysics(), - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), - // padding: EdgeInsets.zero, - // itemCount: womenHealthList.length, - // itemBuilder: (BuildContext context, int index) { - // return womenHealthList[index]; - // }, - // ), - // ), - // ], - // ), - // ), - // ], - // ), - // ) - // ], - // ), ); } @@ -366,7 +155,7 @@ class _HealthCalculatorsState extends State with SingleTicker ), child: MedicalProfileItem( title: TranslationBase.of(context).calories, - imagePath: 'assets/images/new-design/ovulation_period_icon.png', + imagePath: 'assets/images/new-design/calories-calculator.png', subTitle: TranslationBase.of(context).calcHealth, isPngImage: true, ), @@ -379,7 +168,7 @@ class _HealthCalculatorsState extends State with SingleTicker ), child: MedicalProfileItem( title: TranslationBase.of(context).bmr, - imagePath: 'assets/images/new-design/ovulation_period_icon.png', + imagePath: 'assets/images/new-design/BMR_calculator.png', subTitle: TranslationBase.of(context).calcHealth, isPngImage: true, ), @@ -392,7 +181,7 @@ class _HealthCalculatorsState extends State with SingleTicker ), child: MedicalProfileItem( title: TranslationBase.of(context).idealBody, - imagePath: 'assets/images/new-design/ovulation_period_icon.png', + imagePath: 'assets/images/new-design/body_weight.png', subTitle: TranslationBase.of(context).weight, isPngImage: true, ), @@ -405,7 +194,7 @@ class _HealthCalculatorsState extends State with SingleTicker ), child: MedicalProfileItem( title: TranslationBase.of(context).bodyWord, - imagePath: 'assets/images/new-design/ovulation_period_icon.png', + imagePath: 'assets/images/new-design/body_fat.png', subTitle: TranslationBase.of(context).fat, isPngImage: true, ), @@ -418,7 +207,7 @@ class _HealthCalculatorsState extends State with SingleTicker ), child: MedicalProfileItem( title: TranslationBase.of(context).carbohydrate, - imagePath: 'assets/images/new-design/ovulation_period_icon.png', + imagePath: 'assets/images/new-design/carb_protein.png', subTitle: TranslationBase.of(context).proteinFat, isPngImage: true, ), diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 76fe2f46..97dfc187 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -43,7 +43,7 @@ class _SearchResultsState extends State { }, itemBuilder: (context, index) { return AppExpandableNotifier( - title: widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, + title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, isTitleSingleLine: false, bodyWidget: ListView.separated( shrinkWrap: true, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index cee36817..e7e19f4d 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -295,7 +295,7 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", - "PatientOutSA": authUser.outSA, + "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "SessionID": null, "isDentalAllowedBackend": false, "DeviceTypeID": 1 diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 512a8be1..614e44b8 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2215,6 +2215,36 @@ class TranslationBase { String get drivethruAppo => localizedValues["drivethru-appo"][locale.languageCode]; String get upcomingQRNFC => localizedValues["upcoming-QR-NFC"][locale.languageCode]; + + String get ovulationDesc => localizedValues["ovulation-desc"][locale.languageCode]; + + String get cycleLabel => localizedValues["cycle-label"][locale.languageCode]; + + String get lutealLabel => localizedValues["luteal-label"][locale.languageCode]; + + String get pregnancyTitle => localizedValues["pregnancy-title"][locale.languageCode]; + + String get pregnancyDesc => localizedValues["pregnancy-desc"][locale.languageCode]; + + String get pregnancyDateLabel => localizedValues["pregnancy-date-label"][locale.languageCode]; + + String get ovulationPeriod => localizedValues["ovulation-period"][locale.languageCode]; + + String get from => localizedValues["from"][locale.languageCode]; + + String get to => localizedValues["to"][locale.languageCode]; + + String get conceive => localizedValues["conceive"][locale.languageCode]; + + String get firstTri => localizedValues["firstTri"][locale.languageCode]; + + String get secondTri => localizedValues["secondTri"][locale.languageCode]; + + String get thirdTri => localizedValues["thirdTri"][locale.languageCode]; + + String get seeDoctorsList => localizedValues["seeDoctorsList"][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate {