import 'package:cs_resources/constants/color_constants.dart';
import 'package:domain/entity/response/attendance_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_text_view.dart';

/*
 * 考勤列表
 */
class AttendanceReportItem extends StatelessWidget {
  final int index;
  final AttendanceList item;

  AttendanceReportItem({
    required this.index,
    required this.item,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(vertical: 23, horizontal: 21),
      margin: const EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
      decoration: BoxDecoration(
        color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
        borderRadius: BorderRadius.circular(5), // 设置圆角
      ),
      child: Column(
        mainAxisSize: MainAxisSize.max,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // 工作日期
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "${"Job Date".tr}:",
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //日期
              MyTextView(
                item.jobDate ?? "-",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ),

          // 部门
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "Outlet:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //部门
              MyTextView(
                "等待部门返回字段",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 员工姓名
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "${"Staff Name".tr}:",
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              // 员工姓名
              MyTextView(
                item.staffName ?? "-",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 开始时间
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "Start Time:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //日期时间
              MyTextView(
                item.startTime ?? "-",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 结束时间
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "End Time:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //日期时间
              MyTextView(
                item.endTime ?? "-",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 签到时间
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "Work In:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //文本
              MyTextView(
                item.checkInTime.toString(),
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 签出时间
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "Work Out:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //文本
              MyTextView(
                item.checkOutTime ?? "-",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 加减时间
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "+/- Hours:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //文本
              MyTextView(
               "等待修改时间的字段",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),

          // 总时间
          Row(
            mainAxisSize: MainAxisSize.max,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MyTextView(
                "Total Hours:".tr,
                isFontRegular: true,
                textColor: ColorConstants.textGrayAECAE5,
                fontSize: 14,
              ),

              //文本
              MyTextView(
                 "等待总时长的字段",
                marginLeft: 5,
                isFontRegular: true,
                textColor: Colors.white,
                fontSize: 14,
              ).expanded(),
            ],
          ).marginOnly(top: 15),
        ],
      ),
    );
  }
}
