import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';

class SixSwitchsCardDialog extends StatelessWidget {
  final String? switch1Title;
  final String? switch2Title;
  final String? switch3Title;
  final String? switch4Title;
  final String? switch5Title;
  final String? switch6Title;

  final String switch1Up;
  final String switch1Down;
  final String switch2Up;
  final String switch2Down;

  final String switch3Down;
  final String switch3Up;

  final VoidCallback onSwitch1UpTap;
  final VoidCallback onSwitch1DownTap;
  final VoidCallback onSwitch2UpTap;
  final VoidCallback onSwitch2DownTap;

  final VoidCallback onSwitch3DownTap;
  final VoidCallback onSwitch3UpTap;

  SixSwitchsCardDialog(
      {required this.switch1Down,
      required this.switch1Up,
      required this.switch2Down,
      required this.switch2Up,
      required this.onSwitch1UpTap,
      required this.onSwitch1DownTap,
      required this.onSwitch2UpTap,
      required this.onSwitch2DownTap,
      required this.onSwitch3DownTap,
      required this.onSwitch3UpTap,
      required this.switch3Down,
      this.switch1Title,
      this.switch2Title,
      this.switch3Title,
      this.switch4Title,
      this.switch5Title,
      this.switch6Title,
      required this.switch3Up});

  @override
  Widget build(BuildContext context) {
    return Expanded(
      flex: 4,
      child: InkWell(
        overlayColor: MaterialStateProperty.all(Colors.transparent),
        onTap: () {},
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Expanded(
              child: Container(
                margin: const EdgeInsets.symmetric(horizontal: 10),
                decoration: const BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.all(Radius.circular(10)),
                ),
                child: Container(
                  margin: const EdgeInsets.symmetric(horizontal: 10),
                  decoration: BoxDecoration(
                    color: ColorsManager.onPrimaryColor,
                    boxShadow: [
                      BoxShadow(
                        color: Colors.white.withOpacity(0.1),
                        blurRadius: 24,
                        offset: const Offset(-2, -2),
                        blurStyle: BlurStyle.outer,
                      ),
                      BoxShadow(
                        color: Colors.black.withOpacity(0.11),
                        blurRadius: 5,
                        offset: const Offset(2, 0),
                        blurStyle: BlurStyle.outer,
                      ),
                      BoxShadow(
                        color: Colors.white.withOpacity(0.13),
                        blurRadius: 10,
                        offset: const Offset(5, 1),
                        blurStyle: BlurStyle.inner,
                      ),
                    ],
                  ),
                  child: SizedBox(
                    height: 300,
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.center,
                      mainAxisAlignment: MainAxisAlignment.spaceAround,
                      children: [
                        // Switch 1
                        _buildSwitchColumn(
                            switchUp: switch1Up,
                            switchDown: switch1Down,
                            onUpTap: onSwitch1UpTap,
                            onDownTap: onSwitch1DownTap,
                            titleDown: switch4Title!,
                            titleUp: switch1Title!),
                        _buildDivider(),
                        // Switch 2
                        _buildSwitchColumn(
                            switchUp: switch2Up,
                            switchDown: switch2Down,
                            onDownTap: onSwitch2UpTap,
                            onUpTap: onSwitch2DownTap,
                            titleDown: switch5Title!,
                            titleUp: switch2Title!),
                        _buildDivider(),
                        // Switch 3
                        _buildSwitchColumn(
                            switchUp: switch3Up,
                            switchDown: switch3Down,
                            onDownTap: onSwitch3UpTap,
                            onUpTap: onSwitch3DownTap,
                            titleDown: switch6Title!,
                            titleUp: switch3Title!),
                      ],
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget _buildSwitchColumn({
    String switchUp = '',
    String titleUp = '',
    String titleDown = '',
    String switchDown = '',
    VoidCallback? onUpTap,
    VoidCallback? onDownTap,
  }) {
    return Expanded(
      child: Padding(
        padding: const EdgeInsets.only(top: 30, bottom: 30),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Column(
              children: [
                InkWell(
                  onTap: onUpTap,
                  child: Container(
                    height: 20,
                    width: 20,
                    child: SvgPicture.asset(switchUp),
                  ),
                ),
                BodySmall(
                  text: titleUp,
                )
              ],
            ),
            Column(
              children: [
                InkWell(
                  onTap: onDownTap,
                  child: Container(
                    height: 20,
                    width: 20,
                    child: SvgPicture.asset(switchDown),
                  ),
                ),
                BodySmall(
                  text: titleDown,
                )
              ],
            ),
          ],
        ),
      ),
    );
  }

  Widget _buildDivider() {
    return Container(
      width: 3,
      color: ColorsManager.dividerColor,
    );
  }
}
