From 06b2e7f194db70e5445928c511f24fb15bd43949 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Sat, 22 Jan 2022 22:09:48 +0200 Subject: [PATCH 1/3] Fixing the height in my_schedule_widget --- lib/widgets/doctor/my_schedule_widget.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index fe129c31..0bac582f 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -64,8 +64,8 @@ class MyScheduleWidget extends StatelessWidget { ), ), Container( - width: MediaQuery.of(context).size.width * 0.70, - height: MediaQuery.of(context).size.height * 0.18, + width: MediaQuery.of(context).size.width * 0.70, + // height: MediaQuery.of(context).size.height * 0.16, child: CardWithBgWidget( padding: 12, marginLeft: 8, From db83bec292811170d6a079717cf94738cb1b28c2 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Sun, 23 Jan 2022 10:13:24 +0200 Subject: [PATCH 2/3] Fix referred-patient-screen design --- .../referral/referred-patient-screen.dart | 22 ++++-- .../patient-referral-item-widget.dart | 79 +++++++++++-------- 2 files changed, 60 insertions(+), 41 deletions(-) diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index fe40a7e6..e6719052 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../../../util/helpers.dart'; import '../../../../widgets/shared/errors/error_message.dart'; class ReferredPatientScreen extends StatefulWidget { @@ -87,22 +88,27 @@ class _ReferredPatientScreenState extends State { .getReferredPatientItem(index) .referralStatus, patientName: - "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + Helpers.convertToTitleCase( + "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + ), patientGender: model .getReferredPatientItem(index) .gender, - referredDate: AppDateUtils - .convertDateFromServerFormat( + referredDate: AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( model .getReferredPatientItem(index) .referralDate, - "dd/MM/yyyy"), - referredTime: AppDateUtils + ), + isMonthShort: true + ), + referredTime: + AppDateUtils .convertDateFromServerFormat( model .getReferredPatientItem(index) .referralDate, - "hh:mm a"), + " hh:mm a"), patientID: "${model.getReferredPatientItem(index).patientID}", isSameBranch: model @@ -122,7 +128,9 @@ class _ReferredPatientScreenState extends State { .getReferredPatientItem(index) .doctorImageURL, referralDoctorName: - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + Helpers.convertToTitleCase( + "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + ), clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 3935bb6b..ee0d0ffb 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -9,6 +9,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/size_config.dart'; +import '../../util/helpers.dart'; + class PatientReferralItemWidget extends StatelessWidget { final String referralStatus; final int referralStatusCode; @@ -58,6 +61,7 @@ class PatientReferralItemWidget extends StatelessWidget { child: Column( children: [ Container( + height: MediaQuery.of(context).size.height * 0.33, child: CardWithBgWidget( bgColor: referralStatusCode == 1 ? Color(0xffc4aa54) @@ -81,8 +85,8 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 10.0, - letterSpacing: -0.4, + fontSize: 12.0, + letterSpacing: -0.48, fontWeight: FontWeight.w600, color: referralStatusCode == 1 ? Color(0xffc4aa54) @@ -104,6 +108,9 @@ class PatientReferralItemWidget extends StatelessWidget { ) ], ), + SizedBox( + height: 7, + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -126,7 +133,7 @@ class PatientReferralItemWidget extends StatelessWidget { : Icon(DoctorApp.female_1, color: Color(0xffF0448D)), SizedBox( - width: 4, + width: 18, ), AppText( referredTime ?? "", @@ -134,7 +141,7 @@ class PatientReferralItemWidget extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 12.0, color: Color(0XFF575757), - letterSpacing: 0.48, + letterSpacing: -0.48, ) ], ), @@ -163,30 +170,34 @@ class PatientReferralItemWidget extends StatelessWidget { ], ), ), - Row( - children: [ - AppText( - nationality != null ? nationality : "", - fontWeight: FontWeight.w600, - color: Color(0xFF2E303A), - fontSize: 10.0, - letterSpacing: -0.4, - ), - nationalityFlag != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - nationalityFlag, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text(''); - }, - )) - : SizedBox() - ], + Padding( + padding: const EdgeInsets.only(right: 0.1), + child: Row( + children: [ + AppText( + nationality != null ? nationality : "", + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: 10.0, + letterSpacing: -0.4, + ), + nationalityFlag != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + nationalityFlag, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text(''); + }, + ) + ) + : SizedBox() + ], + ), ) ], ), @@ -198,7 +209,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 3, right: 0, top: 0.1), child: Image.asset( isReferral ? 'assets/images/patient/ic_ref_arrow_up.png' @@ -209,8 +220,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), Container( margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + left: 0, top: 18, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 1.0), child: Container( width: 40, height: 40, @@ -219,8 +230,8 @@ class PatientReferralItemWidget extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( doctorAvatar, - height: 25, - width: 30, + height: 28, + width: 28, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { @@ -241,7 +252,7 @@ class PatientReferralItemWidget extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + left: 10, top: 17, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ From e8b51659533945b2f8865207dfe52b78acddee84 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Sun, 23 Jan 2022 11:01:49 +0200 Subject: [PATCH 3/3] Fix some issues --- lib/config/config.dart | 2 +- .../doctor_replay/doctor_reply_widget.dart | 4 ++-- .../add_patient_sick_leave_screen.dart | 4 ++-- .../ReferralDischargedPatientDetails.dart | 2 +- .../referral/my-referral-detail-screen.dart | 2 +- .../referral_patient_detail_in-paint.dart | 2 +- .../referral/referred-patient-screen.dart | 16 +++++----------- .../referred_patient_detail_in-paint.dart | 3 +-- .../patient-referral-item-widget.dart | 19 ++++++------------- 9 files changed, 20 insertions(+), 34 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 748ef31e..11c6dfbc 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -460,7 +460,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; -const Color IN_PROGRESS_COLOR = Color(0xFFCC9B14); /// Timer Info const TIMER_MIN = 10; @@ -471,5 +470,6 @@ class AppGlobal { static Color appGreenColor = Color(0xFF359846); static Color appTextColor = Color(0xFF2B353E); static Color scheduleTextColor = Color(0xFF2E303A); + static Color inProgressColor = Color(0xFFCC9B14); } diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index e8d70786..504462f1 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -34,7 +34,7 @@ class _DoctorReplyWidgetState extends State { bgColor: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR + ? AppGlobal.inProgressColor : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : AppGlobal.appGreenColor, @@ -78,7 +78,7 @@ class _DoctorReplyWidgetState extends State { color: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR + ? AppGlobal.inProgressColor : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : AppGlobal.appGreenColor, diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 9f3c7810..44ffadc1 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -200,7 +200,7 @@ class _AddPatientSickLeaveScreenState extends State { Icon( DoctorApp.warning, size: 20, - color: IN_PROGRESS_COLOR, + color: AppGlobal.inProgressColor, ), SizedBox( width: 10, @@ -211,7 +211,7 @@ class _AddPatientSickLeaveScreenState extends State { .recommendedSickLeaveDays, textAlign: TextAlign.start, fontSize: 12, - color: IN_PROGRESS_COLOR, + color: AppGlobal.inProgressColor, ), ), ], diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 58f9db26..199768b7 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -121,7 +121,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor : Colors.red[700], diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 8d9293fe..87fe16ba 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -110,7 +110,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referralPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referralPatient.referralStatus == 46 || referralPatient diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 66c443c8..d63f856b 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -156,7 +156,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 || referredPatient diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index e6719052..c88a7699 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -11,8 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -import '../../../../util/helpers.dart'; import '../../../../widgets/shared/errors/error_message.dart'; class ReferredPatientScreen extends StatefulWidget { @@ -87,10 +85,8 @@ class _ReferredPatientScreenState extends State { referralStatusCode: model .getReferredPatientItem(index) .referralStatus, - patientName: - Helpers.convertToTitleCase( - "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", - ), + patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientGender: model .getReferredPatientItem(index) .gender, @@ -108,7 +104,7 @@ class _ReferredPatientScreenState extends State { model .getReferredPatientItem(index) .referralDate, - " hh:mm a"), + "hh:mm a"), patientID: "${model.getReferredPatientItem(index).patientID}", isSameBranch: model @@ -127,10 +123,8 @@ class _ReferredPatientScreenState extends State { doctorAvatar: model .getReferredPatientItem(index) .doctorImageURL, - referralDoctorName: - Helpers.convertToTitleCase( - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", - ), + referralDoctorName: "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 401da0aa..6165ce1b 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -15,7 +15,6 @@ 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/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; - import '../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { @@ -156,7 +155,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor : Colors.red[700], diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index ee0d0ffb..6641c253 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,15 +1,10 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../../config/size_config.dart'; import '../../util/helpers.dart'; class PatientReferralItemWidget extends StatelessWidget { @@ -54,17 +49,16 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), child: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.33, child: CardWithBgWidget( bgColor: referralStatusCode == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor + //Color(0xffc4aa54) : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 @@ -89,7 +83,7 @@ class PatientReferralItemWidget extends StatelessWidget { letterSpacing: -0.48, fontWeight: FontWeight.w600, color: referralStatusCode == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 @@ -115,7 +109,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - patientName ?? "", + Helpers.convertToTitleCase(patientName ?? ""), fontSize: 16.0, fontWeight: FontWeight.w600, color: Color(0xff2E303A), @@ -133,7 +127,7 @@ class PatientReferralItemWidget extends StatelessWidget { : Icon(DoctorApp.female_1, color: Color(0xffF0448D)), SizedBox( - width: 18, + width: 50, ), AppText( referredTime ?? "", @@ -142,12 +136,11 @@ class PatientReferralItemWidget extends StatelessWidget { fontSize: 12.0, color: Color(0XFF575757), letterSpacing: -0.48, - ) + ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column(