import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/material.dart';

class MedicationWidget extends StatelessWidget {
  final UcafViewModel model;
  final PrescriptionEntityModel prescription;

  MedicationWidget(this.model, this.prescription);

  @override
  Widget build(BuildContext context) {
    return CardWithBgWidget(
        bgColor: Colors.transparent,
        widget: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Row(
              children: [
                CustomRow(
                  label: "${TranslationBase.of(context).id}: ",
                  value: "${prescription.medicineCode}",
                  isExpanded: false,
                  valueSize: SizeConfig.textMultiplier! * 1.8,
                  labelSize: SizeConfig.textMultiplier! * 1.6,
                ),
                SizedBox(
                  width: 16,
                ),
                CustomRow(
                  label: "${TranslationBase.of(context).price}: ",
                  value: "${prescription.medicationPrice}",
                  isExpanded: false,
                  valueSize: SizeConfig.textMultiplier! * 1.8,
                  labelSize: SizeConfig.textMultiplier! * 1.6,
                ),
                SizedBox(
                  width: 16,
                ),
                CustomRow(
                  label: "${TranslationBase.of(context).quantity}: ",
                  value: "${prescription.quantity}",
                  isExpanded: false,
                  valueSize: SizeConfig.textMultiplier! * 1.8,
                  labelSize: SizeConfig.textMultiplier! * 1.6,
                ),
              ],
            ),
            SizedBox(
              height: 4,
            ),
            CustomRow(
              label: "${TranslationBase.of(context).durDays}: ",
              value: "${prescription.doseDurationDays}",
              isExpanded: false,
              valueSize: SizeConfig.textMultiplier! * 1.8,
              labelSize: SizeConfig.textMultiplier! * 1.6,
            ),
            SizedBox(
              height: 4,
            ),
            CustomRow(
              label: " ",
              value: Utils.convertToTitleCase("${prescription.medicationName}"),
              isExpanded: true,
              valueSize: SizeConfig.textMultiplier! * 1.8,
              labelSize: SizeConfig.textMultiplier! * 1.6,
            ),
            SizedBox(
              height: 4,
            ),

            CustomRow(
              label: " ",
              value: Utils.convertToTitleCase("${prescription.doseDetail}"),
              isExpanded: true,
              valueSize: SizeConfig.textMultiplier! * 1.8,
              labelSize: SizeConfig.textMultiplier! * 1.6,
            ),
          ],
        ));
  }
}
