import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_app/generated/assets.dart';

class WaterHeaterSwitchIcon extends StatelessWidget {
  const WaterHeaterSwitchIcon({super.key, required this.value, required this.action});

  final bool value;
  final Function action;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      overlayColor: MaterialStateProperty.all(Colors.transparent),
      onTap: () {
        action();
      },
      child:  ClipRRect(
        borderRadius: BorderRadius.circular(190.0),
        child: Container(
          decoration: BoxDecoration(
            boxShadow: [
              BoxShadow(
                blurStyle: BlurStyle.inner,
                color: Colors.black.withOpacity(0.1),
                spreadRadius: 9,
                blurRadius: 2,
                offset: const Offset(3, 1),
              ),
            ],
          ),
          child: SvgPicture.asset(
            value ? Assets.waterHeaterOn : Assets.waterHeaterOff,
            fit: BoxFit.fill,
          ),
        ),
      ),
    );
  }
}
