
import 'package:flutter/material.dart';
import 'package:vitalapp/consts/styles.dart';

class CheckCategoryWidget extends StatelessWidget {
  final String label;
  final String assetName;
  final VoidCallback? onTap;

  const CheckCategoryWidget({
    super.key,
    required this.label,
    required this.assetName,
    this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return Material(
      borderRadius: GlobalStyles.borderRadius,
      child: Ink(
        child: InkWell(
          borderRadius: GlobalStyles.borderRadius,
          onTap: () {
            onTap?.call();
          },
          child: Container(
            decoration: BoxDecoration(
              borderRadius: GlobalStyles.borderRadius,
              image: DecorationImage(
                image:
                    AssetImage('assets/images/exam/$assetName'), // 替换为你的背景图路径
                fit: BoxFit.cover,
              ),
            ),
            width: 260,
            height: 290,
            padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 14),
            alignment: Alignment.topLeft,
            child: Text(
              label,
              style: TextStyle(
                fontSize: 28,
                color: Colors.grey.shade700,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
