import 'package:cs_resources/constants/color_constants.dart';
import 'package:cs_resources/generated/assets.dart';
import 'package:domain/entity/response/fiance_report_entity.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:plugin_basic/basic_export.dart';
import 'package:widgets/ext/ex_widget.dart';
import 'package:widgets/my_load_image.dart';
import 'package:widgets/my_text_view.dart';

class ReportFinanceItem extends StatelessWidget {
  final FianceReportRateList item;

  ReportFinanceItem({
    required this.item,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
        borderRadius: BorderRadius.circular(7.5), // 设置圆角
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          //星期与日期
          Row(
            children: [
              MyAssetImage(
                  item.weekNum == "1"
                      ? Assets.cptReportWeekNum1
                      : item.weekNum == "2"
                          ? Assets.cptReportWeekNum2
                          : item.weekNum == "3"
                              ? Assets.cptReportWeekNum3
                              : item.weekNum == "4"
                                  ? Assets.cptReportWeekNum4
                                  : item.weekNum == "5"
                                      ? Assets.cptReportWeekNum5
                                      : item.weekNum == "6"
                                          ? Assets.cptReportWeekNum6
                                          : Assets.cptReportWeekNum7,
                  width: 29,
                  height: 29),
              MyTextView(item.day ?? "", textColor: Colors.white, fontSize: 13.3, isFontBold: true, marginLeft: 13.5),
            ],
          ).marginOnly(left: 15, top: 16, bottom: 14),

          Row(
            children: [
              Column(
                children: [
                  MyTextView(
                    "RQST",
                    textColor: ColorConstants.textGrayAECAE5,
                    fontSize: 11.7,
                    isFontRegular: true,
                  ),
                  MyTextView(
                    item.request.toString(),
                    textColor: ColorConstants.textYellowF8AE00,
                    fontSize: 11,
                    isFontRegular: true,
                  ),
                ],
              ),

              Column(
                children: [
                  MyTextView(
                    "Actual",
                    textColor: ColorConstants.textGrayAECAE5,
                    fontSize: 11.7,
                    isFontRegular: true,
                  ),

                  MyTextView(
                    item.actual.toString(),
                    textColor: ColorConstants.textGreen00FB92,
                    fontSize: 13,
                    isFontBold: true,
                  ),
                ],
              ).marginOnly(left: 5,right: 5),

              Column(
                children: [
                  MyTextView(
                    "Percentage",
                    textColor: ColorConstants.textGrayAECAE5,
                    fontSize: 11.7,
                    isFontRegular: true,
                  ),
                  MyTextView(
                    item.ratio ?? "-",
                    textColor: ColorConstants.textPurpleFF35EE,
                    fontSize: 13,
                    isFontBold: true,
                  ),
                ],
              ).expanded(),
            ],
          ).paddingOnly(left: 10,right: 10).expanded(),
        ],
      ),
    );
  }
}
