From 32d1a19248d41511857c7aa45e5c13852ec8ac88 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 13 Apr 2021 15:53:46 +0300 Subject: [PATCH] bug fixes --- lib/screens/dashboard_screen.dart | 15 +++++++------ lib/screens/patients/patients_screen.dart | 9 ++++---- lib/screens/sick-leave/add-sickleave.dart | 14 ++++++++---- lib/screens/sick-leave/show-sickleave.dart | 13 +++++++---- lib/widgets/patients/PatientCard.dart | 25 ++++++++++++++-------- 5 files changed, 48 insertions(+), 28 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 13e17077..252958b1 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -79,7 +79,8 @@ class _DashboardScreenState extends State { PatientID: 0, From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + To: DateUtils.convertDateToFormat( + DateTime.now().add(Duration(days: 7, hours: 0)), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", @@ -1020,12 +1021,12 @@ class _DashboardScreenState extends State { ), hasBorder: false, onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // SearchMedicinePatientScreen(), - // )); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SearchMedicinePatientScreen(), + )); }, ) ], diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 62485f0d..0efd3a95 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -176,11 +176,12 @@ class _PatientsScreenState extends State { patiantAppointment = convertDateFormat(responseModelList[i].appointmentDate); } + if (patiantAppointment != null) { + String dateAppointment = checkDate(patiantAppointment); - String dateAppointment = checkDate(patiantAppointment); - - if (dateAppointment.contains(str) || str == 'All') { - filterDate.add(responseModelList[i]); + if (dateAppointment.contains(str) || str == 'All') { + filterDate.add(responseModelList[i]); + } } } catch (e) { print(e); diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index ba90cf6e..eb59cdc3 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -10,7 +10,9 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_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/shared/card_with_bgNew_widget.dart'; @@ -29,12 +31,16 @@ class AddSickLeavScreen extends StatelessWidget { onModelReady: (model) => model.getSickLeave(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).sickleave, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + routeArgs['patientType'] ?? "0", + routeArgs['arrivalType'] ?? "0", + ), body: SingleChildScrollView( child: Column(children: [ - PatientProfileHeaderNewDesign( - patient, routeArgs['patientType'], routeArgs['arrivalType']), + // PatientProfileHeaderNewDesign( + // patient, routeArgs['patientType'], routeArgs['arrivalType']), patient.patientStatusType == 43 ? Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index f64147dc..94624b5e 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -30,13 +31,17 @@ class ShowSickLeaveScreen extends StatelessWidget { model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).sickleave, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + routeArgs['patientType'] ?? "0", + routeArgs['arrivalType'] ?? "0", + ), body: SingleChildScrollView( child: Column( children: [ - PatientProfileHeaderNewDesign( - patient, routeArgs['patientType'], routeArgs['arrivalType']), + // PatientProfileHeaderNewDesign( + // patient, routeArgs['patientType'], routeArgs['arrivalType']), Column( children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 394ea216..75cfbf7c 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -102,14 +102,18 @@ class PatientCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row(children: [ - AppText( - (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Container( + width: 170, + child: AppText( + (Helpers.capitalize(patientInfo.firstName) + + " " + + Helpers.capitalize(patientInfo.lastName)), + fontSize: 16, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), ), patientInfo.gender == 1 ? Icon( @@ -143,7 +147,10 @@ class PatientCard extends StatelessWidget { errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { - return Text('No Image'); + return AppText( + 'No Image', + fontSize: 10, + ); }, )) : SizedBox()