From eadfe2d6bcf1f3257caaafc31241bd900ffb207f Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 29 Mar 2021 16:21:48 +0300 Subject: [PATCH] bug fixes --- assets/images/booked.png | Bin 0 -> 412 bytes assets/images/edit.png | Bin 0 -> 435 bytes assets/images/livecare.png | Bin 0 -> 753 bytes assets/images/walkin.png | Bin 0 -> 698 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 20 +- .../patients/patient_search_screen.dart | 7 +- .../add-rescheduleleave.dart | 492 ++++++++---------- .../reschedule-leaves/reschedule_leave.dart | 314 ++++++----- lib/util/translations_delegate_base.dart | 37 +- lib/widgets/patients/PatientCard.dart | 54 +- 11 files changed, 491 insertions(+), 437 deletions(-) create mode 100644 assets/images/booked.png create mode 100644 assets/images/edit.png create mode 100644 assets/images/livecare.png create mode 100644 assets/images/walkin.png diff --git a/assets/images/booked.png b/assets/images/booked.png new file mode 100644 index 0000000000000000000000000000000000000000..e07b7d35bb7696fa8c329f6643552c0b02a91700 GIT binary patch literal 412 zcmeAS@N?(olHy`uVBq!ia0vp^fAw!@bh@lP?1WTzKTB#daL)jpe zU|C};h%%@yW2hDlAj24>7i0pE4Kod*?EnA&*WX0c0iC5^666=mz|JA8q+x1iZV?(6 zpHNWW&^T@8qE&0QZrgw0(BU)Z&tG`<^3A*VA3uHj_Wj3?Uw?M~OSlBo%9!Ns?qaa+ zj_wm6r^eI8F+}3>($lfRP7V?d4~2i-%FzhQN)8OF`2Tq&-}L(e~*Y00pVZFzwM zJA+@v>NSQtpB%gKN=nD#-d~+SukJ9dlYbr^NIqJ|`KIA%TWN2FPi0fd{FQzacGi1^ z@cmxcqo$hsR3-P<>#FmIy1nn)xck;0>&>;@wDC9V{j18ymTs`)1G~rG|!?p`op=v8BGgwZ6WMo}RU?p{0R=jjo}EzP^>dzNN0AwZ5UXo`IFVft8+t zrJezZt!D^iSm}a9fNT({YhVdh02YCWg9SkfKnSEB16k_ng9QKo{~!By{&S%Fj7oz1 zf*DxZ_yq)oghe&9ZEWowT-@9}>smXz`X_AKyk+a&efy7|JbmWe<*T>u-n;+c;hVSb zzI)Ke#gnhZo-E`|vgI*1&%Xl`I$FVdQ&MBb@01pb2-2eap literal 0 HcmV?d00001 diff --git a/assets/images/livecare.png b/assets/images/livecare.png new file mode 100644 index 0000000000000000000000000000000000000000..b1fd3f063a418da25f39e32b16fa730562be5c91 GIT binary patch literal 753 zcmVP000gM1^@s6+B&yD00006VoOIv0RI60 z0RN!9r;`8x0;WksK~y-6os>;zlvfmnpL4%&zC?#2ZID(MI)T<0hni%is0$V9riej9 zMeR-yiW`MmM7wEAH?7p4E-Heq)K&dy!KDq|h)A&s80>^<{DE$iNP_c|`R3l&h5g1! zoJ#0f-h1BjocEl|wXtF`Nz3VB%ngDTF~4|3(5e21<5%XBY$Ju0KVUjI&*H5iGkw%| zfBbs8%aQk270vry0je>kJ^up$U<$Sym<5?A6gsD@<0#&LAxI2xz~YviX~E9~Hk-Kk z?^%#zgUr4H?#!YXU9-Ah-m_`SI!1vnfh0S3Es|@YL9df8;n*OfnB};@Hi9a_`<-Ss z1f&2m)C6>|IECXnu;Mk#Bi%g#FlV+pD4YRX`-Tw(nYKFFK0zVPX?t8}^-LUo>-5p@ zKz}~19~A zGTu9MkauJwD7^2U~b5X$5cDc#tZyg4QpH$ybC;% jbaLRq_|Vwua5N#b&6-&E00000NkvXXu0mjf)&^&F literal 0 HcmV?d00001 diff --git a/assets/images/walkin.png b/assets/images/walkin.png new file mode 100644 index 0000000000000000000000000000000000000000..81f112f54416a587067a74098f04a8a62ad673f7 GIT binary patch literal 698 zcmV;r0!96aP)X1^@s61#ZvJ00006VoOIv0RI60 z0RN!9r;`8x0&ht~K~y-6eUZy=O;Hraf8RbwOB0WHrxhY7RY`AqRI5eqgo%h(A_jsX zBO>B4>cC%MVk!nAF)$!uAV_dksFt*Gl|)d3D^f(&BktMDz`e)0y^U{l_B!8h?{BRo zCaAf+ePJ=KIVoel0xstJa@W)URbg&!u8F749K>iWmCT#Az8uKiD0^HQh-+p>DKmha zV{h6MrVkc}1%*W`z1(YXPadE41nI-*hqqtmE?nf0HUjg^b7C4bR||zVKPLs&baX86 z-t9JN95E`aqbU10S{NCgwCSeSu5%_1Q>h={YHiN@-rgToP2;GiTGQ&jGy9(I7dcelb7{V+E zV8-^M;+!+yd2{VxR{%rw2%xF8Ye|0K!P_W`>c*}1Ik2Rh*7K~5HD`H(^v|&RP;C|6*Xips5DM?!m zzWkfNKT-vlx9(DiT^`$sX>$S@n<{{8HX8yvlHAzq;elMAGcJ`%^H;WZ*C#+>?ALLi zr97D_zk|yFUdko00x}L@MO$YRrk+yWBOMqVy#EBBdO_kUyh7B@CFCK-LDDED40YdFIM$<+IIyvihtTh-QeFbu+5Lyzx{Oazuk gUCX9;ztqe5KN)B4)-yZ*vj6}907*qoM6N<$f;aa*f&c&j literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..98393a63 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,7 +4,7 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; @@ -234,6 +234,7 @@ const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; + ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTIONS_ALL_ORDERS = @@ -246,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; - var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a1f63710..e7871d86 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -394,7 +394,7 @@ const Map> localizedValues = { 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, 'to': {'en': "To", 'ar': 'إلى'}, - 'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'}, + 'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'}, 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, 'pleaseEnterDate': { 'en': 'Please enter leave start date', @@ -785,7 +785,21 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + "searchWithOther": { + "en": "Search With Other Criteria", + "ar": "البحث بمعايير أخرى" + }, + "hideOtherCriteria": { + "en": "Hide Other Criteria", + "ar": "إخفاء المعايير الأخرى" + }, + "applyForReschedule": { + "en": "Apply for leave or reschedule", + "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" + }, + "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, + "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, - - + "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, + "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, }; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 45d457cd..0ae5452b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -210,11 +210,14 @@ class _PatientSearchScreenState extends State { InkWell( child: this.isView == false ? AppText( - 'Search With Other Critearia', + TranslationBase.of(context) + .searchWithOther, color: Colors.red, fontWeight: FontWeight.bold, ) - : AppText('Hide Other Criteria', + : AppText( + TranslationBase.of(context) + .hideOtherCriteria, color: Colors.red, fontWeight: FontWeight.bold), onTap: () { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 0dab0226..dacbba72 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -7,6 +7,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -18,287 +20,251 @@ class AddRescheduleLeavScreen extends StatelessWidget { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => - {model.getRescheduleLeave(), model.getCoveringDoctors()}, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: model.getReschduleLeave.length > 0 - ? SingleChildScrollView( + onModelReady: (model) => + {model.getRescheduleLeave(), model.getCoveringDoctors()}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: Column(children: [ + Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.all(10), + padding: + EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), + decoration: BoxDecoration( + color: HexColor('#EAEAEA'), + borderRadius: BorderRadius.all(Radius.circular(20))), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(10)), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openLeave( + context, + false, + ); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).applyForReschedule, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 18, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * .65, + child: SingleChildScrollView( + child: Column( + children: model.getReschduleLeave + .map((GetRescheduleLeavesResponse item) { + return RoundedContainer( child: Column( children: [ - SizedBox(height: 50), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 20), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - child: Row( - children: [ - Expanded( - flex: 4, - child: AppText( - TranslationBase.of(context) - .requestLeave), - ), - IconButton( - icon: Icon( - Icons.add_circle, - color: Colors.red, - )) - ], - ) - // AppTextFormField( - // hintText: - // TranslationBase.of(context).requestLeave, - // borderColor: Colors.white, - // prefix: IconButton( - // icon: Icon( - // Icons.add_circle, - // color: Colors.red, - // )), - // // textInputType: TextInputType.text, - // readOnly: true, - // onTap: () { - // openLeave( - // context, - // false, - // ); - // return false; - // }, - // inputFormatter: ONLY_LETTERS, - // ) - , - onTap: () { - openLeave( - context, - false, - ); - }, - ) - ], - ), - ), - Column( - children: model.getReschduleLeave.map( - (GetRescheduleLeavesResponse item) { - return CardWithBgWidgetNew( - widget: Column( - children: [ - Container( - padding: - EdgeInsets.only(left: 10, right: 10), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: - EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase - .of(context) - .approved - : item.status == 2 - ? TranslationBase.of( - context) - .pending - : TranslationBase.of( - context) - .rejected, - fontWeight: - FontWeight.bold, - color: Colors.white, - ), - color: item.status == 1 - ? Colors.green - : item.status == 2 - ? Colors - .yellow[800] - : Colors.red[800], - ), - SizedBox( - height: 5, - ), - Container( - child: AppText( - item.requisitionType == 1 - ? TranslationBase.of( - context) - .offTime - : TranslationBase.of( - context) - .holiday + - ' ', - fontWeight: - FontWeight.bold, - )), - Row( - children: [ - Flexible( - child: Text( - DateUtils.convertStringToDateFormat( - item - .dateTimeFrom, - 'yyyy-MM-dd HH:mm') + - ' ' + - TranslationBase.of( - context) - .to + - ' ' + - DateUtils.convertStringToDateFormat( - item.dateTimeTo, - 'yyyy-MM-dd HH:mm') - // overflow: - // TextOverflow.ellipsis, - )) - ], - ), - SizedBox( - height: 5, - ), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + width: 5.0, + ))), + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.status == 1 + ? TranslationBase.of( + context) + .approved + : item.status == 2 + ? TranslationBase.of( + context) + .pending + : TranslationBase.of( + context) + .rejected, + fontWeight: FontWeight.bold, + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + fontSize: 14, + ), + ), + SizedBox( + height: 5, + ), + Container( + child: AppText( + item.requisitionType == 1 + ? TranslationBase.of(context) + .offTime + : TranslationBase.of(context) + .holiday + + ' ', + fontWeight: FontWeight.bold, + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText( + TranslationBase.of(context) + .startDate), + AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeFrom, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + + // overflow: + // TextOverflow.ellipsis, + ]), + + // overflow: + // TextOverflow.ellipsis, + + SizedBox( + height: 5, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .endDate), + AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + ], + ), + + SizedBox( + height: 5, + ), + model.coveringDoctors.length > 0 + ? Row(children: [ AppText( TranslationBase.of( context) .coveringDoctor, - fontWeight: - FontWeight.bold, ), - model.coveringDoctors - .length > - 0 - ? Row(children: [ - AppText(getDoctor( - model - .coveringDoctors, - item.coveringDoctorId)) - ]) - : SizedBox(), AppText( - TranslationBase.of( - context) - .reasons, + getDoctor( + model.coveringDoctors, + item.coveringDoctorId), fontWeight: FontWeight.bold, - ), - model.allReasons.length > 0 - ? Row(children: [ - AppText(getReasons( - model - .allReasons, - item.reasonId)) - ]) - : SizedBox(), - ], - ), - SizedBox( - width: 10, - ), - ], - ), - ), - (item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.edit_outlined, - size: 30, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - openLeave(context, true, - extendedData: item) - }, - )) - : SizedBox(), - ], - )), - SizedBox( - height: 10, - ), - Divider( - height: 1, + ) + ]) + : SizedBox(), + // AppText( + // TranslationBase.of(context) + // .reasons, + // fontWeight: FontWeight.bold, + // ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 5), + child: AppText(getReasons( + model.allReasons, + item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => { + openLeave( + context, true, + extendedData: + item) + }, + ) + : SizedBox(), + ]), + ], + ), + SizedBox( + width: 10, + ), + ], + ), ), ], - )); - }).toList(), - ) + )), ], ), - ) - : new Builder(builder: (context) { - return Center( - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all( - color: HexColor('#B8382C'), width: 4), - borderRadius: - BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context).noReScheduleLeave, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - ), - )); - }), - )); + ); + }).toList(), + ))) + ])), + ); } openLeave(BuildContext context, isExtend, {extendedData}) { - showModalBottomSheet( - context: context, - builder: (context) { - return new Container( - child: RescheduleLeaveScreen( - isExtend, - extendedData, - )); - }); + // showModalBottomSheet( + // context: context, + // builder: (context) { + // return new Container( + // child: RescheduleLeaveScreen( + // isExtend, + // extendedData, + // )); + // }); + + Navigator.push( + context, + FadePage( + page: RescheduleLeaveScreen( + isExtend, + extendedData, + ), + ), + ); } getDoctor(model, doctorId) { diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 7b034431..e873f9b1 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -114,12 +114,13 @@ class _RescheduleLeaveScreen extends State { model2.getCoveringDoctors() }, builder: (_, model2, w) => GestureDetector( - onTap: (){ - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( baseViewModel: model2, - isShowAppBar: false, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -130,8 +131,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -139,7 +140,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -151,58 +153,64 @@ class _RescheduleLeaveScreen extends State { children: [ Expanded( // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - dropdownColor: - Colors.grey, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( + child: + DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + focusColor: + Colors.grey, + isExpanded: true, + dropdownColor: + Colors.grey, + value: getClinicName( + model) ?? + "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: < + Widget>[ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + color: Colors + .grey[ + 500], + ), + ], + ); + }).toList(); + }, + onChanged: + (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: item + .toString(), + child: Text( item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .grey[500], + textAlign: + TextAlign + .end, ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), + ); + }).toList(), + ))), ), ], ) @@ -216,7 +224,8 @@ class _RescheduleLeaveScreen extends State { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -238,8 +247,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -247,7 +256,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -262,7 +272,8 @@ class _RescheduleLeaveScreen extends State { // add Expanded to have your dropdown button fill remaining space child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButton( // focusColor: Colors.grey, isExpanded: true, value: offTime == null @@ -272,12 +283,14 @@ class _RescheduleLeaveScreen extends State { iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext context) { + (BuildContext + context) { return model2.allOffTime .map((item) { return Row( mainAxisSize: - MainAxisSize.max, + MainAxisSize + .max, children: [ AppText( item[ @@ -297,12 +310,22 @@ class _RescheduleLeaveScreen extends State { offTime = newValue; }), if (offTime == '1') - {model2.getReasons(18)} + { + model2 + .getReasons(18) + } else if (offTime == '2') - {model2.getReasons(19)} - else if (offTime == '3' || + { + model2 + .getReasons(19) + } + else if (offTime == + '3' || offTime == '5') - {model2.getReasons(102)} + { + model2 + .getReasons(102) + } }, items: model2.allOffTime .map((item) { @@ -335,20 +358,21 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of(context) - .fromDate, + hintText: TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon( - Icons.calendar_today)), + icon: Icon(Icons + .calendar_today)), textInputType: TextInputType.number, controller: _toDateController, @@ -372,11 +396,12 @@ class _RescheduleLeaveScreen extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(6.0)), + Radius.circular( + 6.0)), border: Border.all( width: 1.0, - color: - HexColor("#CCCCCC"))), + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: @@ -387,8 +412,8 @@ class _RescheduleLeaveScreen extends State { TranslationBase.of( context) .fromTime, - type: - DateTimePickerType.time, + type: DateTimePickerType + .time, controller: _controller4, onChanged: (val) => fromTime = val, @@ -411,11 +436,12 @@ class _RescheduleLeaveScreen extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(6.0)), + Radius.circular( + 6.0)), border: Border.all( width: 1.0, - color: - HexColor("#CCCCCC"))), + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: @@ -426,8 +452,8 @@ class _RescheduleLeaveScreen extends State { TranslationBase.of( context) .toTime, - type: - DateTimePickerType.time, + type: DateTimePickerType + .time, controller: _controller5, onChanged: (val) => toTime = val, @@ -457,23 +483,26 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: + TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons .calendar_today)), textInputType: TextInputType.number, - controller: _toDateController, + controller: + _toDateController, onTap: () { _presentDatePicker( 'fromDate'); @@ -493,21 +522,22 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase - .of(context) - .toDate, + hintText: + TranslationBase + .of(context) + .toDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon( - Icons - .calendar_today)), + icon: Icon(Icons + .calendar_today)), textInputType: TextInputType.number, controller: @@ -529,8 +559,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -538,7 +568,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -553,7 +584,8 @@ class _RescheduleLeaveScreen extends State { // add Expanded to have your dropdown button fill remaining space child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButton( focusColor: Colors.grey, isExpanded: true, value: reason == null @@ -564,12 +596,14 @@ class _RescheduleLeaveScreen extends State { iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext context) { + (BuildContext + context) { return model2.allReasons .map((item) { return Row( mainAxisSize: - MainAxisSize.max, + MainAxisSize + .max, children: [ AppText( projectsProvider @@ -603,7 +637,8 @@ class _RescheduleLeaveScreen extends State { projectsProvider .isArabic ? item['nameAr'] - : item['nameEn'], + : item[ + 'nameEn'], textAlign: TextAlign.end, ), @@ -621,8 +656,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -630,7 +665,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -649,33 +685,36 @@ class _RescheduleLeaveScreen extends State { dropdownSearchDecoration: InputDecoration( contentPadding: - EdgeInsets.all( - 0), - border: InputBorder - .none), + EdgeInsets + .all(0), + border: + InputBorder + .none), //maxHeight: 300, items: model2 .coveringDoctors .map((item) { return projectsProvider .isArabic - ? item['doctorNameN'] - : item['doctorName']; + ? item[ + 'doctorNameN'] + : item[ + 'doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { model2.coveringDoctors - .forEach((newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal[ - 'DoctorID'] - } - }); + .forEach( + (newVal) => { + if (newVal['doctorName'] == + item || + newVal['doctorName'] == + item) + { + doctorID = + newVal['DoctorID'] + } + }); }, selectedItem: getSelectedDoctor( @@ -693,8 +732,10 @@ class _RescheduleLeaveScreen extends State { ), popupTitle: Container( height: 50, - decoration: BoxDecoration( - color: Theme.of(context) + decoration: + BoxDecoration( + color: Theme.of( + context) .primaryColorDark, borderRadius: BorderRadius.only( @@ -712,8 +753,10 @@ class _RescheduleLeaveScreen extends State { style: TextStyle( fontSize: 24, fontWeight: - FontWeight.bold, - color: Colors.white, + FontWeight + .bold, + color: + Colors.white, ), ), ), @@ -723,9 +766,11 @@ class _RescheduleLeaveScreen extends State { borderRadius: BorderRadius.only( topLeft: - Radius.circular(24), + Radius.circular( + 24), topRight: - Radius.circular(24), + Radius.circular( + 24), ), ), ), @@ -805,8 +850,11 @@ class _RescheduleLeaveScreen extends State { children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context).update - : TranslationBase.of(context).add, + ? TranslationBase.of(context) + .updateReschedule + : TranslationBase.of(context) + .addReschedule, + color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { if (widget.isUpdate == true) { @@ -837,7 +885,7 @@ class _RescheduleLeaveScreen extends State { ), ), ), - ))); + ))); } getProfile() async { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 331b2812..b2ed3aff 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1145,26 +1145,45 @@ class TranslationBase { String get billNo => localizedValues['BillNo'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['prescriptions'][locale.languageCode]; String get notes => localizedValues['notes'][locale.languageCode]; String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - - + String get searchWithOther => + localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => + localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => + localizedValues['applyForReschedule'][locale.languageCode]; + + String get startDate => localizedValues['startDate'][locale.languageCode]; + String get endDate => localizedValues['endDate'][locale.languageCode]; + + String get addReschedule => + localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => + localizedValues['update-reschedule'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 9ecc6a23..c53a38d7 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -84,13 +84,15 @@ class PatientCard extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) - : AppText( - DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + : patientInfo.arrivedOn != null + ? AppText( + DateUtils.convertStringToDateFormat( + patientInfo.arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : SizedBox() ], )) : SizedBox(), @@ -124,7 +126,9 @@ class PatientCard extends StatelessWidget { AppText( patientInfo.nationalityName != null ? patientInfo.nationalityName - : patientInfo.nationality, + : patientInfo.nationality != null + ? patientInfo.nationality + : "", fontWeight: FontWeight.bold, fontSize: 14, ), @@ -286,29 +290,29 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.all(4), - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(8), - topLeft: Radius.circular(8), - ), - color: patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? HexColor('#D02127') - : patientInfo.appointmentType == - 'Walkin' - ? HexColor('#28323A') - : HexColor('#6C7379'), - ), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.only( + // bottomRight: Radius.circular(8), + // topLeft: Radius.circular(8), + // ), + // color: patientInfo.appointmentType == + // 'Regular' && + // patientInfo.visitTypeId == 100 + // ? HexColor('#D02127') + // : patientInfo.appointmentType == + // 'Walkin' + // ? HexColor('#28323A') + // : HexColor('#6C7379'), + // ), child: Image.asset( patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 - ? 'assets/images/type-livecare.png' + ? 'assets/images/livecare.png' : patientInfo.appointmentType == 'Walkin' - ? 'assets/images/type-walkin.png' - : 'assets/images/type-booked.png', + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', height: 25, width: 35, )),