import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/order-procedure.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/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/material.dart';

class ProceduresWidget extends StatelessWidget {
  final UcafViewModel model;
  final OrderProcedure procedure;

  ProceduresWidget(this.model, this.procedure);

  @override
  Widget build(BuildContext context) {
    return
      CardWithBgWidget(
        bgColor: Colors.transparent,
        widget:
        Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Expanded(
                  child: CustomRow(
                    label: "${TranslationBase.of(context).codeNo}: ",
                    value: "${procedure.achiCode}",
                    isExpanded: false,
                    valueSize: SizeConfig.textMultiplier! * 1.8,
                    labelSize: SizeConfig.textMultiplier! * 1.6,
                  ),
                ),
                SizedBox(width: 10,),
                Expanded(
                  child: CustomRow(
                    label: "${TranslationBase.of(context).quantity}: ",
                    value: "1",//done as prescribed https://cloudsolutions-sa.atlassian.net/browse/V4-40476?focusedCommentId=471705
                    isExpanded: false,
                    valueSize: SizeConfig.textMultiplier! * 1.8,
                    labelSize: SizeConfig.textMultiplier! * 1.6,
                  ),
                ),
              ],
            ),
            SizedBox(
              height: 4,
            ),
            CustomRow(
              label: "",
              value: "${procedure.procedureName}",
              valueSize: SizeConfig.textMultiplier! * 1.8,
              labelSize: SizeConfig.textMultiplier! * 1.6,
            ),
            SizedBox(
              height: 4,
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Expanded(
                  child: CustomRow(
                    label: "${TranslationBase.of(context).covered}: ",
                    value: "${procedure.isCovered}",
                    isExpanded: false,
                    valueSize: SizeConfig.textMultiplier! * 1.8,
                    labelSize: SizeConfig.textMultiplier! * 1.6,
                    valueColor: procedure.isCovered!
                        ? AppGlobal.appGreenColor
                        : AppGlobal.appRedColor,
                  ),
                ),
                Expanded(
                  child: CustomRow(
                    label: "${TranslationBase.of(context).approvalRequired}: ",
                    value: "${procedure.isApprovalRequired}",
                    isExpanded: false,
                    valueSize: SizeConfig.textMultiplier! * 1.8,
                    labelSize: SizeConfig.textMultiplier! * 1.6,
                  ),
                ),


              ],
            ),
            SizedBox(
              height: 4,
            ),

            CustomRow(
              label: "${TranslationBase.of(context).uncoveredByDoctor}: ",
              value: "${procedure.isUncoveredByDoctor}",
              isExpanded: false,
              valueSize: SizeConfig.textMultiplier! * 1.8,
              labelSize: SizeConfig.textMultiplier! * 1.6,
              valueColor: procedure.isCovered!
                  ? AppGlobal.appGreenColor
                  : AppGlobal.appRedColor,
            ),
            SizedBox(
              height: 16,
            )
          ],
        )
    );
  }
}
