import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.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-new-design_in_patient.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import '../../../routes.dart'; class InPatientProfileScreen extends StatefulWidget { @override _InPatientProfileScreenState createState() => _InPatientProfileScreenState(); } class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { PatiantInformtion patient; bool isFromSearch = false; bool isInpatient = false; bool isDischargedPatient = false; String patientType; String arrivalType; String from; String to; @override void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; from = routeArgs['from']; to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } if (routeArgs.containsKey("isInpatient")) { isInpatient = routeArgs['isInpatient']; } if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } } @override Widget build(BuildContext context) { return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), body: SingleChildScrollView( child: Container( margin: EdgeInsets.only(top: 10), child: Padding( padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), child: GridView.count( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, from: from, to: to, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, isInPatient: true, icon: 'patient/vital_signs.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).result, icon: 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, isDischargedPatient: isDischargedPatient, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, isDischargedPatient: isDischargedPatient, nameLine1: "Order", //"Text", nameLine2: "Sheet", //TranslationBase.of(context).orders, icon: 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isDisable: true, route: MEDICAL_FILE, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'patient/patient_sick_leave.png'), ], ), ), ), ), )); } } class AvatarWidget extends StatelessWidget { final Widget avatarIcon; AvatarWidget(this.avatarIcon); @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( boxShadow: [ BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0) ], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), child: avatarIcon, ); } }