From f56a23aad96dcf38de66036f7de5d8fe50dc2116 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 14 Sep 2021 17:38:07 +0300 Subject: [PATCH 1/5] fix lab issue --- .../Prescriptions/prescription_report.dart | 28 +++++++------- .../prescription_report_enh.dart | 38 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index d2427004..006a6fad 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,13 +1,13 @@ class PrescriptionReport { String address; - int appointmentNo; + dynamic appodynamicmentNo; String clinic; String companyName; - int days; + dynamic days; String doctorName; var doseDailyQuantity; String frequency; - int frequencyNumber; + dynamic frequencyNumber; String image; String imageExtension; String imageSRCUrl; @@ -15,30 +15,30 @@ class PrescriptionReport { String imageThumbUrl; String isCovered; String itemDescription; - int itemID; + dynamic itemID; String orderDate; - int patientID; + dynamic patientID; String patientName; String phoneOffice1; String prescriptionQR; - int prescriptionTimes; + dynamic prescriptionTimes; String productImage; String productImageBase64; String productImageString; - int projectID; + dynamic projectID; String projectName; String remarks; String route; String sKU; - int scaleOffset; + dynamic scaleOffset; String startDate; String patientAge; String patientGender; String phoneOffice; - int doseTimingID; - int frequencyID; - int routeID; + dynamic doseTimingID; + dynamic frequencyID; + dynamic routeID; String name; String itemDescriptionN; String routeN; @@ -46,7 +46,7 @@ class PrescriptionReport { PrescriptionReport({ this.address, - this.appointmentNo, + this.appodynamicmentNo, this.clinic, this.companyName, this.days, @@ -92,7 +92,7 @@ class PrescriptionReport { PrescriptionReport.fromJson(Map json) { address = json['Address']; - appointmentNo = json['AppointmentNo']; + appodynamicmentNo = json['AppodynamicmentNo']; clinic = json['Clinic']; companyName = json['CompanyName']; days = json['Days']; @@ -141,7 +141,7 @@ class PrescriptionReport { final Map data = new Map(); data['Address'] = this.address; - data['AppointmentNo'] = this.appointmentNo; + data['AppodynamicmentNo'] = this.appodynamicmentNo; data['Clinic'] = this.clinic; data['CompanyName'] = this.companyName; data['Days'] = this.days; diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 203eaaff..01b9a5c9 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,41 +1,41 @@ class PrescriptionReportEnh { String address; - int appointmentNo; + dynamic appodynamicmentNo; String clinic; - Null companyName; - int days; + dynamic companyName; + dynamic days; String doctorName; - int doseDailyQuantity; + dynamic doseDailyQuantity; String frequency; - int frequencyNumber; - Null image; - Null imageExtension; + dynamic frequencyNumber; + dynamic image; + dynamic imageExtension; String imageSRCUrl; - Null imageString; + dynamic imageString; String imageThumbUrl; String isCovered; String itemDescription; - int itemID; + dynamic itemID; String orderDate; - int patientID; + dynamic patientID; String patientName; String phoneOffice1; - Null prescriptionQR; - int prescriptionTimes; - Null productImage; - Null productImageBase64; + dynamic prescriptionQR; + dynamic prescriptionTimes; + dynamic productImage; + dynamic productImageBase64; String productImageString; - int projectID; + dynamic projectID; String projectName; String remarks; String route; String sKU; - int scaleOffset; + dynamic scaleOffset; String startDate; PrescriptionReportEnh( {this.address, - this.appointmentNo, + this.appodynamicmentNo, this.clinic, this.companyName, this.days, @@ -70,7 +70,7 @@ class PrescriptionReportEnh { PrescriptionReportEnh.fromJson(Map json) { address = json['Address']; - appointmentNo = json['AppointmentNo']; + appodynamicmentNo = json['AppodynamicmentNo']; clinic = json['Clinic']; companyName = json['CompanyName']; days = json['Days']; @@ -107,7 +107,7 @@ class PrescriptionReportEnh { Map toJson() { final Map data = new Map(); data['Address'] = this.address; - data['AppointmentNo'] = this.appointmentNo; + data['AppodynamicmentNo'] = this.appodynamicmentNo; data['Clinic'] = this.clinic; data['CompanyName'] = this.companyName; data['Days'] = this.days; From f095da8943edc616f997479588b1ad73f1252743 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 20 Sep 2021 10:09:57 +0300 Subject: [PATCH 2/5] fix inpatient issue --- lib/screens/patients/In_patient/in_patient_screen.dart | 3 +++ lib/widgets/shared/text_fields/text_fields_utils.dart | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index c5de8866..d7bd805a 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_Li import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; 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'; @@ -50,7 +51,9 @@ class _InPatientScreenState extends State } _handleTabSelection() { + Helpers.hideKeyboard(context); setState(() { + widget.showBottomSheet = false; _activeTab = _tabController.index; }); } diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 54c7e494..1f1ff2bb 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -46,7 +46,7 @@ class TextFieldsUtils{ borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderRadius: BorderRadius.circular(8), ),*/ - hintText: selectedText != null ? selectedText : hintText, + hintText: selectedText != null ? selectedText : hintText??"", suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), hintStyle: TextStyle( From 6dd8f62b2ada9521359ecea688e031466fbeec9d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 22 Sep 2021 09:59:10 +0300 Subject: [PATCH 3/5] fix reschedule --- lib/config/config.dart | 4 +- .../add-rescheduleleave.dart | 290 +++++----- .../reschedule-leaves/reschedule_leave.dart | 511 ++++++------------ 3 files changed, 308 insertions(+), 497 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b8e34330..407d4ff6 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.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"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 43d4ae68..f6e1b8d7 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -29,162 +29,168 @@ class AddRescheduleLeavScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: SingleChildScrollView( child: Column(children: [ - AddNewOrder( - onTap: () async { - await locator().logEvent( - eventCategory: "Add Reschedule" - "Leave Screen", - eventAction: "apply For Reschedule", - ); - openLeave( - context, - false, - ); - }, - label: TranslationBase.of(context).applyForReschedule, + Padding( + padding: const EdgeInsets.all(8.0), + child: AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Add Reschedule" + "Leave Screen", + eventAction: "apply For Reschedule", + ); + openLeave( + context, + false, + ); + }, + label: TranslationBase.of(context).applyForReschedule, + ), ), Column( children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { - return RoundedContainer( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - 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: [ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - padding: EdgeInsets.all(3), - margin: EdgeInsets.only(top: 10), - child: AppText( - item.statusDescription, - fontWeight: FontWeight.bold, - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - fontSize: 14, + return Padding( + padding: const EdgeInsets.all(8.0), + child: RoundedContainer( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + 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: [ + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.statusDescription, + fontWeight: FontWeight.bold, + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + fontSize: 14, + ), ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + AppDateUtils.convertStringToDateFormat( + item.createdOn, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + )) + ]), + SizedBox( + height: 5, ), - Padding( - padding: EdgeInsets.only(top: 10), + Container( child: AppText( - AppDateUtils.convertStringToDateFormat( - item.createdOn, 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - )) - ]), - SizedBox( - height: 5, - ), - Container( - child: AppText( - item.requisitionType == 1 - ? TranslationBase.of(context).offTime - : item.requisitionType == 2 - ? TranslationBase.of(context).holiday - : item.requisitionType == 3 - ? TranslationBase.of(context).changeOfSchedule - : TranslationBase.of(context).newSchedule, - fontWeight: FontWeight.bold, - )), - SizedBox( - height: 5, - ), - Row(children: [ - AppText(TranslationBase.of(context).startDate), - AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), + item.requisitionType == 1 + ? TranslationBase.of(context).offTime + : item.requisitionType == 2 + ? TranslationBase.of(context).holiday + : item.requisitionType == 3 + ? TranslationBase.of(context).changeOfSchedule + : TranslationBase.of(context).newSchedule, fontWeight: FontWeight.bold, - ) - - // overflow: - // TextOverflow.ellipsis, - ]), - - // overflow: - // TextOverflow.ellipsis, - - SizedBox( - height: 5, - ), - Row( - children: [ - AppText(TranslationBase.of(context).endDate), + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText(TranslationBase.of(context).startDate), AppText( AppDateUtils.convertStringToDateFormat( - item.dateTimeTo, 'yyyy-MM-dd HH:mm'), + item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) - ], - ), - SizedBox( - height: 5, - ), - model.coveringDoctors.length > 0 - ? Row(children: [ - AppText( - TranslationBase.of(context).coveringDoctor, - ), - AppText( - getDoctor(model.coveringDoctors, item.coveringDoctorId), - fontWeight: FontWeight.bold, - ) - ]) - : 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)}, - ) + // overflow: + // TextOverflow.ellipsis, + ]), + + // overflow: + // TextOverflow.ellipsis, + + SizedBox( + height: 5, + ), + Row( + children: [ + AppText(TranslationBase.of(context).endDate), + AppText( + AppDateUtils.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, + ), + AppText( + getDoctor(model.coveringDoctors, item.coveringDoctorId), + fontWeight: FontWeight.bold, + ) + ]) : SizedBox(), - ]), - ], - ), - SizedBox( - width: 10, - ), - ], + // 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(), diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 98e9f9ec..925d0bb7 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -45,8 +45,8 @@ class _RescheduleLeaveScreen extends State { var date; var doctorID; var reason; - var fromDate; - var toDate; + dynamic fromDate; + dynamic toDate; var clinicID; String fromTime; String toTime; @@ -80,12 +80,12 @@ class _RescheduleLeaveScreen extends State { } }); - setState(() { - final df = new DateFormat('yyyy-MM-dd'); - fromDate = pickedDate; //df.format(); - _toDateController.text = df.format(pickedDate); - toDate = pickedDate; - }); + // setState(() { + // final df = new DateFormat('yyyy-MM-dd'); + // fromDate = pickedDate; //df.format(); + // //_toDateController2.text = df.format(pickedDate); + // //toDate = pickedDate; + // }); }); } @@ -99,9 +99,7 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - offTime = widget.updateData != null - ? widget.updateData.requisitionType.toString() - : offTime; + offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -248,22 +246,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, 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( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -271,34 +264,22 @@ class _RescheduleLeaveScreen extends State { model2.allOffTime.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( // focusColor: Colors.grey, isExpanded: true, - value: offTime == null - ? model2.allOffTime[0] - ['code'] - : offTime, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allOffTime - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - item[ - 'description'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + item['description'], + + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -306,38 +287,27 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => { + onChanged: (newValue) { setState(() { offTime = newValue; - }), - if (offTime == '1') - { - model2 - .getReasons(18) - } - else if (offTime == '2') - { - model2 - .getReasons(19) - } - else if (offTime == - '3' || - offTime == '5') - { - model2 - .getReasons(102) - } + }); + if (offTime == '1') { + model2.getReasons(18); + } else if (offTime == '2') { + model2.getReasons(19); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); + setState(() { + offTime = newValue; + }); + } }, - items: model2.allOffTime - .map((item) { - return DropdownMenuItem< - String>( - value: item['code'] - .toString(), + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), child: Text( item['description'], - textAlign: - TextAlign.end, + textAlign: TextAlign.end, ), ); }).toList(), @@ -355,37 +325,24 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + 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, + 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, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (val) => - fromDate = val, - onSaved: (val) => - fromDate = val, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, ) ], )), @@ -395,37 +352,24 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + 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, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .fromTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, controller: _controller4, - onChanged: (val) => - fromTime = val, + onChanged: (val) => fromTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - fromTime = val, + onSaved: (val) => fromTime = val, ) ], ), @@ -435,37 +379,24 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + 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, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .toTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, controller: _controller5, - onChanged: (val) => - toTime = val, + onChanged: (val) => toTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - toTime = val, + onSaved: (val) => toTime = val, ) ], ), @@ -480,38 +411,26 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + 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, + 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, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + readOnly: true, + controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { setState(() { - toDate = value; + fromDate = value; }); }), ], @@ -519,33 +438,21 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + 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, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase - .of(context) - .toDate, + hintText: TranslationBase.of(context).toDate, + readOnly: true, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController2, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, onTap: () { - _presentDatePicker( - 'toDate'); + _presentDatePicker('toDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -560,22 +467,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, 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( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -583,39 +485,23 @@ class _RescheduleLeaveScreen extends State { model2.allReasons.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: reason == null - ? model2.allReasons[0] - ['id'] - .toString() - : reason, + value: model2.allReasons[0]['id'].toString() ?? "", iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allReasons - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - projectsProvider - .isArabic - ? item[ - 'nameAr'] - : item[ - 'nameEn'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -628,20 +514,12 @@ class _RescheduleLeaveScreen extends State { reason = newValue; }) }, - items: model2.allReasons - .map((item) { - return DropdownMenuItem< - String>( - value: item['id'] - .toString(), + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), child: Text( - projectsProvider - .isArabic - ? item['nameAr'] - : item[ - 'nameEn'], - textAlign: - TextAlign.end, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), ); }).toList(), @@ -657,22 +535,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, 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( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -683,69 +556,35 @@ class _RescheduleLeaveScreen extends State { child: DropdownSearch( mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets - .all(0), - border: - InputBorder - .none), + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), //maxHeight: 300, - items: model2 - .coveringDoctors - .map((item) { - return projectsProvider - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName']; + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'] + : item['doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { - model2.coveringDoctors - .forEach( - (newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal['DoctorID'] - } - }); + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item) + doctorID = newVal['DoctorID'] + }); }, - selectedItem: - getSelectedDoctor( - model2), + selectedItem: getSelectedDoctor(model2), showSearchBox: true, - searchBoxDecoration: - InputDecoration( - border: - OutlineInputBorder(), - contentPadding: - EdgeInsets.fromLTRB( - 12, 12, 8, 0), - labelText: - "Search Doctor", + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", ), popupTitle: Container( height: 50, - decoration: - BoxDecoration( - color: Theme.of( - context) - .primaryColorDark, - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 20), - topRight: - Radius.circular( - 20), + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), ), ), child: Center( @@ -753,25 +592,16 @@ class _RescheduleLeaveScreen extends State { '', style: TextStyle( fontSize: 24, - fontWeight: - FontWeight - .bold, - color: - Colors.white, + fontWeight: FontWeight.bold, + color: Colors.white, ), ), ), ), - popupShape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 24), - topRight: - Radius.circular( - 24), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), ), ), ), @@ -845,17 +675,14 @@ class _RescheduleLeaveScreen extends State { )), SizedBox(height: SizeConfig.screenHeight * .3), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context) - .updateReschedule - : TranslationBase.of(context) - .addReschedule, + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { @@ -865,9 +692,7 @@ class _RescheduleLeaveScreen extends State { addRecheduleLeave(model2); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .onlyOfftimeHoliday); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); } }, ), @@ -900,16 +725,13 @@ class _RescheduleLeaveScreen extends State { final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); this.offTime = widget.updateData.requisitionType.toString(); - _toDateController.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = - df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = this.toTime.substring(0, this.toTime.length - 3); - _toDateController2.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _controller5.text = toTime; _controller4.text = fromTime; toDate = _toDateController2.text; @@ -922,8 +744,7 @@ class _RescheduleLeaveScreen extends State { getClinicName(model) { var clinicID = this.profile['ClinicID'] ?? 1; - var clinicInfo = - model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } @@ -933,16 +754,10 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString())); - toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString())); + fromDate = df.format( + DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); + toDate = df + .format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -957,8 +772,7 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -981,10 +795,9 @@ class _RescheduleLeaveScreen extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - // MyReferredPatient(), - ), + builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') + // MyReferredPatient(), + ), ); } }); @@ -993,22 +806,17 @@ class _RescheduleLeaveScreen extends State { updateRecheduleLeave(model) { // final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); final df = new DateFormat('yyyy-MM-dd'); - var fromDates = fromDate; - var toDates = toDate; + String dataS = DateTime.now().toIso8601String(); + dynamic fromDates = fromDate; + dynamic toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString(); + fromDate = + df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); + toDate = + df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); } else { - fromDate = df.format(fromDates); - toDate = df.format(toDates); + fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); + toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); } Map request = { @@ -1021,8 +829,7 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -1045,9 +852,8 @@ class _RescheduleLeaveScreen extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - ), + builder: (context) => AddRescheduleLeavScreen(), + settings: RouteSettings(name: 'AddRescheduleLeaveScreen')), ); } }); @@ -1061,8 +867,7 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) - {doctorName = newVal['doctorName']} + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} }); return doctorName; } From 96ee21b15f2df0a560b86e5696a423927513550b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 22 Sep 2021 12:24:29 +0300 Subject: [PATCH 4/5] change server url --- lib/config/config.dart | 4 ++-- pubspec.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 407d4ff6..b8e34330 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.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"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/pubspec.lock b/pubspec.lock index 53035a4a..43aefcb2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -692,7 +692,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -1026,7 +1026,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1231,5 +1231,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0" From 7d4f6d526457bb1eb22fd48f50c6f6455e4f1106 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 23 Sep 2021 11:14:04 +0300 Subject: [PATCH 5/5] adding slide up to prescription and procedure --- .../radiology/radiology_home_page.dart | 93 +++++++------------ .../prescription/prescriptions_page.dart | 15 +-- lib/screens/procedures/procedure_screen.dart | 15 +-- lib/widgets/transitions/slide_up_page.dart | 18 ++-- 4 files changed, 55 insertions(+), 86 deletions(-) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 46b5ad28..958301fd 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -12,6 +12,7 @@ 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/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -44,8 +45,7 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -63,8 +63,7 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -84,8 +83,7 @@ class _RadiologyHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -105,20 +103,19 @@ class _RadiologyHomePageState extends State { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - model: model, - procedureType: ProcedureType.RADIOLOGY, - ), settings: RouteSettings(name: 'AddProcedureTabPage') - ), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.RADIOLOGY, + ), + settingRoute: 'AddProcedureTabPage'), ); }, label: TranslationBase.of(context).applyForRadiologyOrder, @@ -143,43 +140,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - topRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0)), + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -187,29 +167,21 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - model.radiologyList[index].doctorName, - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: model - .radiologyList[index].clinicDescription, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate, + model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], - patient: patient, - isInpatient:isInpatient - ), + finalRadiology: model.radiologyList[index], + patient: patient, + isInpatient: isInpatient), ), ); }, @@ -218,8 +190,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 905ee09a..801669cb 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -95,13 +96,13 @@ class PrescriptionsPage extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - prescriptionModel: model, - procedureType: ProcedureType.PRESCRIPTION, - ), - settings: RouteSettings(name: 'AddProcedureTabPage')), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + prescriptionModel: model, + procedureType: ProcedureType.PRESCRIPTION, + ), + settingRoute: 'AddProcedureTabPage'), ); }, label: TranslationBase.of(context).applyForNewPrescriptionsOrder, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index de356935..79fb961c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/transitions/slide_up_page.dart'; import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; @@ -99,13 +100,13 @@ class ProcedureScreen extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - model: model, - procedureType: ProcedureType.PROCEDURE, - ), - settings: RouteSettings(name: 'AddProcedureTabPage')), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.PROCEDURE, + ), + settingRoute: 'AddProcedureTabPage'), ); }, child: Container( diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index f534e2a3..ee0b7473 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; + final String settingRoute; - SlideUpPageRoute( - {this.widget, this.fullscreenDialog = false, this.opaque = true}) + SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, @@ -24,21 +24,17 @@ class SlideUpPageRoute extends PageRouteBuilder { opaque: opaque, barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierDismissible: true, - settings: RouteSettings(name: widget.runtimeType.toString()), + settings: RouteSettings(name: settingRoute ?? widget.runtimeType.toString()), transitionDuration: Duration(milliseconds: 800), - transitionsBuilder: ((BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child) { + transitionsBuilder: + ((BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { var begin = Offset(0.0, 1.0); var end = Offset.zero; var curve = Curves.easeInOutQuint; - var tween = - Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); - return SlideTransition( - position: animation.drive(tween), child: child); + return SlideTransition(position: animation.drive(tween), child: child); }), ); }