diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index abcba69e..555e19cf 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -10,6 +10,7 @@ class GetRescheduleLeavesResponse { int requisitionType; int status; String createdOn; + String statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, @@ -21,7 +22,8 @@ class GetRescheduleLeavesResponse { this.requisitionNo, this.requisitionType, this.status, - this.createdOn}); + this.createdOn, + this.statusDescription}); GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; @@ -35,6 +37,7 @@ class GetRescheduleLeavesResponse { requisitionType = json['requisitionType']; status = json['status']; createdOn = json['createdOn']; + statusDescription = json['statusDescription']; } Map toJson() { @@ -50,6 +53,7 @@ class GetRescheduleLeavesResponse { data['requisitionType'] = this.requisitionType; data['status'] = this.status; data['createdOn'] = this.createdOn; + data['statusDescription'] = this.statusDescription; return data; } } diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index f3fc8032..de831213 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -7,7 +7,7 @@ class GetAllSickLeaveResponse { int requestNo; String startDate; int status; - + String statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, @@ -16,7 +16,8 @@ class GetAllSickLeaveResponse { this.remarks, this.requestNo, this.startDate, - this.status}); + this.status, + this.statusDescription}); GetAllSickLeaveResponse.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -27,6 +28,7 @@ class GetAllSickLeaveResponse { requestNo = json['requestNo']; startDate = json['startDate']; status = json['status']; + statusDescription = json['statusDescription']; } Map toJson() { @@ -39,6 +41,7 @@ class GetAllSickLeaveResponse { data['requestNo'] = this.requestNo; data['startDate'] = this.startDate; data['status'] = this.status; + data['statusDescription'] = this.statusDescription; return data; } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index d06e05e1..42d2648b 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -562,48 +563,74 @@ class _PatientsScreenState extends State { // color: Color(0xffCCCCCC), // ), Container( - // decoration: BoxDecoration( - // color: Color(0Xffffffff), - // borderRadius: - // BorderRadius.circular(20)), - child: (responseModelList.length > 0) - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: responseModelList - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: patientType, - arrivalType: arrivalType, - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - patientType, - "from": patient - .getFrom, - "to": - patient.getTo, - "isSearch": - isSearch, - "arrivalType": - arrivalType, - }); - }, - ); - }).toList(), - ) - : Center( - child: DrAppEmbeddedError( - error: TranslationBase.of( - context) - .youDontHaveAnyPatient), - ), - ), + // decoration: BoxDecoration( + // color: Color(0Xffffffff), + // borderRadius: + // BorderRadius.circular(20)), + child: (responseModelList.length > + 0) + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: responseModelList + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + patientType, + "from": patient + .getFrom, + "to": patient + .getTo, + "isSearch": + isSearch, + "arrivalType": + arrivalType, + }); + }, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: Texts( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + ) + // : Center( + // child: DrAppEmbeddedError( + // error: TranslationBase.of( + // context) + // .youDontHaveAnyPatient), + // ), + ), ], ), ) diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 41f7c6aa..bd753080 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -80,11 +80,11 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.green + ? Colors.red[800] : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 - ? Colors.red[800] + ? Colors.green : Colors.red, width: 5.0, ))), @@ -109,29 +109,14 @@ class AddRescheduleLeavScreen extends StatelessWidget { margin: EdgeInsets.only(top: 10), child: AppText( - item.status == 10 - ? TranslationBase.of( - context) - .accepted - : item.status == 2 - ? TranslationBase.of( - context) - .pending - : item.status == 9 - ? TranslationBase - .of( - context) - .rejected - : TranslationBase - .of(context) - .cancelled, + item.statusDescription, fontWeight: FontWeight.bold, color: item.status == 10 - ? Colors.green + ? Colors.red[800] : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 - ? Colors.red[800] + ? Colors.green : Colors.red, fontSize: 14, ), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 87071e6e..45088b8d 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -243,21 +243,21 @@ class AddSickLeavScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts('No Sick Leave Found'), - ) - - ], - ), - ) + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Sick Leave Found'), + ) + ], + ), + ) : SizedBox() - ])))); } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 94624b5e..6085dc19 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -128,8 +128,7 @@ class ShowSickLeaveScreen extends StatelessWidget { AppText( item.remarks ?? "", ), - (item.status == 1 || - item.status == 2) + (item.status == 1) ? IconButton( icon: Image.asset( 'assets/images/edit.png'), diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index f64221b8..42028dcc 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -857,7 +857,8 @@ class _VerificationMethodsState extends State { authProv.setDoctorProfile(doctor); sharedPref.setObj(DOCTOR_PROFILE, profile); projectsProvider.isLogin = true; - Navigator.of(context).pushReplacementNamed(HOME); + + Navigator.of(context).popAndPushNamed(HOME); } getDocProfiles(ClinicModel clinicInfo, authProv) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 75cfbf7c..611f4898 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -129,9 +129,9 @@ class PatientCard extends StatelessWidget { children: [ AppText( patientInfo.nationalityName != null - ? patientInfo.nationalityName + ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality + ? patientInfo.nationality.trim() : "", fontWeight: FontWeight.bold, fontSize: 14,