import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:taafee_mobile/features/card/data_layer/model/working_time.dart';

import '../../../../common/const/const.dart';
import '../../../../common/widgets/listview.dart';
import '../../../../common/widgets/text.dart';

class WorkingTimeWidget extends StatelessWidget {
  final List<WorkingTimeModel> list = [
    WorkingTimeModel(type: "Sunday", startTime: "8:00", endTime: "10:00"),
    WorkingTimeModel(type: "Monday", startTime: "8:00", endTime: "10:00"),
    WorkingTimeModel(type: "Sunday", startTime: "8:00", endTime: "10:00"),
  ];
  WorkingTimeWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
        width: Get.width * .89,
        height: 270,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(10),
        ),
        child: Stack(
          children: [
            const BoldTextWidget(
              "working time",
              color: Colors.grey,
            ).paddingSymmetric(horizontal: 20),
            ListViewWidget(
                physics: const BouncingScrollPhysics(),
                itemCount: 8,
                scrollDirection: Axis.horizontal,
                childBuilder: (index) {
                  return Column(
                    crossAxisAlignment: CrossAxisAlignment.end,
                    children: [
                      const RegularTextWidget("8:00"),
                      Expanded(
                        child: Container(
                          width: 1,
                          color: AppColors.dividerColor,
                        ),
                      ),
                    ],
                  ).paddingSymmetric(horizontal: 10);
                }).paddingOnly(top: 25),
            SizedBox(
              width: Get.width * .89,
              child: ListViewWidget(
                  itemCount: list.length,
                  childBuilder: (index) {
                    return SizedBox(
                      width: Get.width * .89,
                      height: 42,
                      child: ListViewWidget(
                          padding: const EdgeInsets.only(top: 20),
                          scrollDirection: Axis.horizontal,
                          itemCount: list.length,
                          childBuilder: (index) {
                            return Container(
                              alignment: Alignment.center,
                              margin: const EdgeInsets.symmetric(horizontal: 10),
                              width: 100,
                              decoration: BoxDecoration(
                                color: AppColors.secondaryColor,
                                borderRadius: BorderRadius.circular(25),
                              ),
                              child: RegularTextWidget(
                                list[index].type,
                                color: Colors.white,
                              ),
                            );
                          }),
                    );
                  }),
            ).paddingOnly(top: 30)
          ],
        ));
  }
}
