diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index df646ca9..f10f2253 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -9,19 +9,14 @@ class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; - Future getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -29,24 +24,22 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { url = GET_IN_PATIENT_ORDERS; body['ProjectID'] = patient.projectId; } - + finalRadiologyList.clear(); hasError = false; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; String label = "ListRAD"; if (isInPatient) { label = "List_GetRadOreders"; } - if(response[label] == null || response[label].length == 0){ + if (response[label] == null || response[label].length == 0) { label = "FinalRadiologyList"; } response[label].forEach((radiology) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 0d059000..26d85f62 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -18,12 +18,7 @@ class LabResultWidget extends StatelessWidget { final bool isInpatient; LabResultWidget( - {Key key, - this.filterName, - this.patientLabResultList, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient, this.isInpatient}) : super(key: key); ProjectViewModel projectViewModel; @@ -37,32 +32,32 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // if (!isInpatient) - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient, - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(filterName), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient, ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - ), + ), + ); + }, + child: AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, ), - ], - ), + ), + ], + ), Row( children: [ Expanded( @@ -122,9 +117,9 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - '${patientLabResultList[index].testCode}\n' + - patientLabResultList[index].description, + '${patientLabResultList[index].testCode}\n' + patientLabResultList[index].description, textAlign: TextAlign.center, + isCopyable: true, ), ), ), @@ -135,10 +130,10 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - patientLabResultList[index].resultValue ??""+ - " " + - "${patientLabResultList[index].uOM ?? ""}", + patientLabResultList[index].resultValue ?? + "" + " " + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, + isCopyable: true, ), ), ), @@ -151,6 +146,7 @@ class LabResultWidget extends StatelessWidget { child: AppText( patientLabResultList[index].referanceRange, textAlign: TextAlign.center, + isCopyable: true, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 08c247ee..5130f7ab 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -88,20 +88,16 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .generalResult, + TranslationBase.of(context).generalResult, bold: true, ))), Container( width: 25, height: 25, child: Icon( - _isShowMoreGeneral - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -132,11 +128,8 @@ class _LaboratoryResultWidgetState extends State { model.labResultLists.length, (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, + filterName: model.labResultLists[index].filterName, + patientLabResultList: model.labResultLists[index].patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, ), @@ -173,20 +166,16 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .specialResult, + TranslationBase.of(context).specialResult, bold: true, ))), Container( width: 25, height: 25, child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -211,14 +200,10 @@ class _LaboratoryResultWidgetState extends State { width: double.infinity, child: !Helpers.isTextHtml(widget.details) ? AppText( - widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + widget.details ?? TranslationBase.of(context).noDataAvailable, ) : Html( - data: widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index dfc1a1e8..48c35952 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -29,7 +29,6 @@ class _LabsHomePageState extends State { bool isInpatient; bool isFromLiveCare; - @override void didChangeDependencies() { super.didChangeDependencies(); @@ -66,8 +65,7 @@ class _LabsHomePageState extends State { SizedBox( height: 12, ), - if (model.patientLabOrdersList.isNotEmpty && - patient.patientStatusType != 43) + if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -87,8 +85,7 @@ class _LabsHomePageState 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( @@ -108,8 +105,7 @@ class _LabsHomePageState extends State { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { @@ -146,37 +142,26 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - color: model.patientLabOrdersList[index] - .isLiveCareAppointment + color: model.patientLabOrdersList[index].isLiveCareAppointment ? Colors.red[900] - : !model.patientLabOrdersList[index] - .isInOutPatient + : !model.patientLabOrdersList[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.patientLabOrdersList[index] - .isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.patientLabOrdersList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -190,24 +175,18 @@ class _LabsHomePageState extends State { page: LaboratoryResultPage( patientLabOrders: model.patientLabOrdersList[index], patient: patient, - isInpatient:isInpatient, + isInpatient: isInpatient, arrivalType: arrivalType, patientType: patientType, ), ), ), - doctorName: - model.patientLabOrdersList[index].doctorName, - invoiceNO: - ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model - .patientLabOrdersList[index].doctorImageURL, - branch: - model.patientLabOrdersList[index].projectName, - clinic: model - .patientLabOrdersList[index].clinicDescription, - appointmentDate: - model.patientLabOrdersList[index].orderDate.add(Duration(days: 1)), + doctorName: model.patientLabOrdersList[index].doctorName, + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: model.patientLabOrdersList[index].clinicDescription, + appointmentDate: model.patientLabOrdersList[index].orderDate, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), @@ -216,8 +195,7 @@ class _LabsHomePageState extends State { ), ), ), - if (model.patientLabOrdersList.isEmpty && - patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 93613275..1e742de9 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -75,6 +75,7 @@ class RadiologyDetailsPage extends StatelessWidget { child: AppText( '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, + isCopyable: true, fontSize: 17, color: Color(0xff575757), ), diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 8b2f7de4..a0b110bc 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -137,9 +137,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -176,10 +174,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 3.5, ), patient.startTime != null - ? AppText( - patient.startTime != null - ? patient.startTime - : '', + ? AppText(patient.startTime != null ? patient.startTime : '', fontWeight: FontWeight.w700, fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -270,7 +265,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), - // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -308,9 +302,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( @@ -357,7 +349,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), if (invoiceNO != null && !isPrescriptions) HeaderRow( - label: 'Invoice: ', + label: 'Invoice: ', value: invoiceNO ?? "", ), if (branch != null) @@ -387,8 +379,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { : 'Prescriptions Date ', value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - ), - ]), + ), + ]), ), ), ], diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 89c69736..56a503a8 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -62,7 +62,7 @@ class AppText extends StatefulWidget { this.textOverflow, this.textDecoration, this.letterSpacing, - this.isCopyable = true, + this.isCopyable = false, }); @override @@ -103,10 +103,7 @@ class _AppTextState extends State { margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), + top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -121,21 +118,16 @@ class _AppTextState extends State { right: 0, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], - begin: Alignment.bottomCenter, - end: Alignment.topCenter)), + gradient: LinearGradient(colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), height: 30, ), ) ], ), - if (widget.allowExpand && - widget.readMore && - text.length > widget.maxLength) + if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -172,13 +164,7 @@ class _AppTextState extends State { ), child: Container( child: SelectableText( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -196,8 +182,7 @@ class _AppTextState extends State { fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing ?? - (widget.variant == "overline" ? 1.5 : null), + letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, @@ -207,19 +192,9 @@ class _AppTextState extends State { ); } else { return Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null - ? ((widget.maxLines > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) - : null, + overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( @@ -231,8 +206,7 @@ class _AppTextState extends State { fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing ?? - (widget.variant == "overline" ? 1.5 : null), + letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, diff --git a/pubspec.lock b/pubspec.lock index e2215d0c..0229e774 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -664,7 +664,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -956,7 +956,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1154,5 +1154,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0"