import 'package:elektronika/app/core/themes/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class IncrementDecrementButton extends StatelessWidget {
  final VoidCallback callback;
  final IconData icon;

  IncrementDecrementButton({
    required this.callback,
    required this.icon,
  });

  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.transparent,
      borderRadius: BorderRadius.circular(8),
      child: InkWell(
        borderRadius: icon == Icons.add
            ? BorderRadius.only(
                topRight: Radius.circular(8),
                bottomRight: Radius.circular(8),
              )
            : BorderRadius.only(
                topLeft: Radius.circular(8),
                bottomLeft: Radius.circular(8),
              ),
        highlightColor: ThemeColor.mainColor.withOpacity(0.20),
        onTap: () => callback(),
        child: Container(
          height: double.infinity,
          padding: const EdgeInsets.symmetric(horizontal: 8),
          child: Icon(this.icon, size: 16.sp),
        ),
      ),
    );
  }
}
