diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/header.dart index eb404e70..0fbcdf1a 100644 --- a/lib/screens/patients/patient_search/header.dart +++ b/lib/screens/patients/patient_search/header.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class HeaderInSearch extends StatelessWidget { +class HeaderInSearch extends StatelessWidget with PreferredSizeWidget { final String title; const HeaderInSearch({Key key, this.title}) : super(key: key); @@ -16,7 +16,7 @@ class HeaderInSearch extends StatelessWidget { ), child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 35), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -36,4 +36,8 @@ class HeaderInSearch extends StatelessWidget { ), ); } + + @override + + Size get preferredSize => Size(double.maxFinite,65); } diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index e4e1ed4c..8786bc48 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -206,7 +206,7 @@ class _PatientsScreenNewState extends State { bottom: 30), ), onChanged: (String str) { - // this.searchData(str); + model.searchData(str); }), ])), SizedBox( diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 43a4b79d..f7f39d95 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -35,18 +35,18 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - // if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") - // Container( - // height: MediaQuery.of(context).size.height * .20, - // width: 5, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(10), - // bottomLeft: Radius.circular(10)), - // color: patientInfo.patientStatusType == 43 - // ? Colors.green[500] - // : Colors.red[800], - // )), + if (isInpatient) + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: patientInfo.patientStatusType == 43 + ? Colors.green[500] + : Colors.red[800], + )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,48 +55,47 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - // SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient" - // ? Padding( - // padding: EdgeInsets.only(left: 12.0), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // patientInfo.patientStatusType == 43 - // ? AppText( - // TranslationBase.of(context).arrivedP, - // color: Colors.green, - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 12, - // ) - // : AppText( - // TranslationBase.of(context).notArrived, - // color: Colors.red[800], - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 12, - // ), - // this.arrivalType == '1' - // ? AppText( - // patientInfo.startTime != null - // ? patientInfo.startTime - // : patientInfo.startTimes, - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ) - // : patientInfo.arrivedOn != null - // ? AppText( - // DateUtils.convertStringToDateFormat( - // patientInfo.arrivedOn, - // 'MM-dd-yyyy HH:mm'), - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ) - // : SizedBox() - // ], - // )) - // : SizedBox(), + !isInpatient + ? Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patientInfo.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + this.arrivalType == '1' + ? AppText( + patientInfo.startTime != null + ? patientInfo.startTime + : patientInfo.startTimes, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : patientInfo.arrivedOn != null + ? AppText( + DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate( + patientInfo.arrivedOn, + )), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : SizedBox() + ], + )) + : SizedBox(), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -213,33 +212,32 @@ class PatientCard extends StatelessWidget { ), ), ), - // if (SERVICES_PATIANT2[int.parse(patientType)] != - // "List_MyInPatient") - // Container( - // child: RichText( - // text: new TextSpan( - // style: new TextStyle( - // fontSize: 2.0 * SizeConfig.textMultiplier, - // color: Colors.black, - // fontFamily: 'Poppins', - // ), - // children: [ - // new TextSpan( - // text: - // TranslationBase.of(context).age + - // " : ", - // style: TextStyle(fontSize: 14)), - // new TextSpan( - // text: - // "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", - // style: TextStyle( - // fontWeight: FontWeight.w700, - // fontSize: 15)), - // ], - // ), - // ), - // ), - if (isInpatient == true) + if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: + TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), + ), + ), + if (isInpatient ) Container( child: RichText( text: new TextSpan( @@ -370,28 +368,26 @@ class PatientCard extends StatelessWidget { //) ])) ]), - // SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient" - // ? Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Container( - // padding: EdgeInsets.all(4), - // child: Image.asset( - // patientInfo.appointmentType == - // 'Regular' && - // patientInfo.visitTypeId == 100 - // ? 'assets/images/livecare.png' - // : patientInfo.appointmentType == - // 'Walkin' - // ? 'assets/images/walkin.png' - // : 'assets/images/booked.png', - // height: 25, - // width: 35, - // )), - // ]) - // : - (isInpatient == true) + !isInpatient + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', + height: 25, + width: 35, + )), + ]) + : (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [