import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:freekake/screen/camera_screen.dart';

class ScanButton extends StatelessWidget {
  const ScanButton({super.key});
  static const Color transparent = Color(0xFFFFFFF);

  @override
  Widget build(BuildContext context) {
    final screenWidth = MediaQuery.of(context).size.width;

    // Skala berdasarkan lebar layar
    final buttonSize = screenWidth * 0.20; // Adjust as needed
    final iconSize = buttonSize * 0.7;
    final padding = buttonSize * 0.15;

    return Container(
      width: buttonSize,
      height: buttonSize,
      // width: 76,
      // height: 76,
      decoration: BoxDecoration(
        shape: BoxShape.circle,
        color: const Color.fromARGB(223, 67, 63, 179),
      ),
      padding: EdgeInsets.all(padding),
      child: IconButton(
        icon: SvgPicture.asset(
          'assets/icons/Scan.svg',
          width: iconSize,
          height: iconSize,
          colorFilter: ColorFilter.mode(
            Color.fromARGB(255, 217, 219, 227),
            BlendMode.srcIn,
          ),
        ),
        onPressed: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => CameraScreen()),
          );
        },
      ),
    );
  }
}