import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';

import '../../../../routes.dart';

// ignore: must_be_immutable
class ProfileGridForInPatient extends StatelessWidget {
  final PatiantInformtion? patient;
  final String? patientType;
  final String? arrivalType;
  final double? height;
  final bool isInpatient;
  final bool isDischargedPatient;
  final bool isFromSearch;
  final bool isVidaPlusProject;
  String? from;
  String? to;

  ProfileGridForInPatient(
      {Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isDischargedPatient = false, this.isFromSearch = false, required  this.isVidaPlusProject})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    final List<PatientProfileCardModel> cardsList = [
      PatientProfileCardModel(
        TranslationBase.of(context).vital,
        TranslationBase.of(context).signs,
        VITAL_SIGN_DETAILS,
        'assets/images/svgs/profile_screen/vital signs.svg',
        isInPatient: isInpatient,
        isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).lab,
        TranslationBase.of(context).result,
        LAB_RESULT,
        'assets/images/svgs/profile_screen/lab results.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject

      ),
      PatientProfileCardModel(
        TranslationBase.of(context).lab,
        TranslationBase.of(context).special,
        ALL_SPECIAL_LAB_RESULT,
        'assets/images/svgs/profile_screen/lab results.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).radiology,
        TranslationBase.of(context).result,
        RADIOLOGY_PATIENT,
        'assets/images/svgs/profile_screen/Radiology.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).patient,
        TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
        ORDER_PRESCRIPTION_OLD,
        'assets/images/svgs/profile_screen/order prescription.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).patient,
        TranslationBase.of(context).prescription,
        ORDER_PRESCRIPTION_NEW,
        'assets/images/svgs/profile_screen/order prescription.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).progress,
        TranslationBase.of(context).note,
        PROGRESS_NOTE,
        'assets/images/svgs/profile_screen/Progress notes.svg',
        isInPatient: isInpatient,
        isDischargedPatient: isDischargedPatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).order,
        TranslationBase.of(context).sheet,
        ORDER_NOTE,
        'assets/images/svgs/profile_screen/order sheets.svg',
        isInPatient: isInpatient,
        isDischargedPatient: isDischargedPatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).orders,
        TranslationBase.of(context).procedures,
        ORDER_PROCEDURE,
        'assets/images/svgs/profile_screen/Order Procedures.svg',
        isInPatient: isInpatient,
        //onTap: () {},
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).health,
        TranslationBase.of(context).summary,
        HEALTH_SUMMARY,
        'assets/images/svgs/profile_screen/health summary.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).medical,
        TranslationBase.of(context).report,
        PATIENT_MEDICAL_REPORT,
        'assets/images/svgs/profile_screen/medical report.svg',
        isInPatient: isInpatient,
        isDisable: false,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).referral,
        TranslationBase.of(context).patient,
        REFER_IN_PATIENT_TO_DOCTOR,
        'assets/images/svgs/profile_screen/refer patient.svg',
        isInPatient: isInpatient,
        isDisable: isDischargedPatient || isFromSearch,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).insurance,
        TranslationBase.of(context).approvals,
        PATIENT_INSURANCE_APPROVALS_NEW,
        'assets/images/svgs/profile_screen/insurance approval.svg',
        isInPatient: isInpatient,
        //onTap: () {},
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).discharge,
        TranslationBase.of(context).report,
        DISCHARGE_SUMMARY,
        'assets/images/svgs/profile_screen/discharge summary.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).patientSick,
        TranslationBase.of(context).leave,
        ADD_SICKLEAVE,
        'assets/images/svgs/profile_screen/patient sick leave.svg',
        isInPatient: isInpatient,
        //onTap: () {},
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).operation,
        TranslationBase.of(context).report,
        GET_OPERATION_REPORT,
        'assets/images/svgs/profile_screen/operating report.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject,
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).pending,
        TranslationBase.of(context).orders,
        PENDING_ORDERS,
        'assets/images/svgs/profile_screen/pending orders.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).admission,
        TranslationBase.of(context).orders,
        ADMISSION_ORDERS,
        'assets/images/svgs/profile_screen/admission req.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        "Nursing",
        TranslationBase.of(context).progressNote,
        NURSING_PROGRESS_NOTE,
        'assets/images/svgs/profile_screen/Progress notes.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).diagnosis,
        "",
        DIAGNOSIS_FOR_IN_PATIENT,
        'assets/images/svgs/profile_screen/diagnosis.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).diabetic,
        TranslationBase.of(context).chart,
        DIABETIC_CHART_VALUES,
        'assets/images/svgs/profile_screen/diabetic chart.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        "VTE",
        "Assessment",
        VTE_ASSESSMENT,
        'assets/images/svgs/profile_screen/diabetic chart.svg',
          isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
      PatientProfileCardModel(
        TranslationBase.of(context).pharmacy,
        TranslationBase.of(context).intervention,
        PHARMACY_INTERVENTION,
        'assets/images/svgs/profile_screen/medical report.svg',
        isInPatient: isInpatient,
          isVidaPlusProject: isVidaPlusProject
      ),
    ];

    return Padding(
      padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
      child: GridView(
        shrinkWrap: true,
        physics: BouncingScrollPhysics(),
        // if you want IOS bouncing effect, otherwise remove this line
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisSpacing: 10,
          mainAxisSpacing: 8,
          crossAxisCount: 3,
        ),
        //change the number as you want
        children: cardsList.map((item) {
          return PatientProfileButton(
            patient: patient!,
            patientType: patientType!,
            arrivalType: arrivalType!,
            from: from ??"",
            to: to ??"",
            nameLine1: item.nameLine1,
            nameLine2: item.nameLine2,
            route: item.route,
            icon: item.icon,
            isInPatient: item.isInPatient,
            isDischargedPatient: item.isDischargedPatient,
            isDisable: item.isDisable,
            onTap: item.onTap,
            isLoading: item.isLoading,
            isVidaPlusProject: item.isVidaPlusProject
          );
        }).toList(),
      ),
    );
  }
}
