import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';

Widget saleOrBuyItemCard({
  String? title,
  String? iconPath,
  required VoidCallback onTap,
  Color? color,
}) {
  return InkWell(
    borderRadius: BorderRadius.circular(8.r),
    onTap: onTap,
    child: Card(
      color: Colors.white,
      shape: RoundedRectangleBorder(
        side: BorderSide(color: color ?? AppColor.blueNormal, width: 1.0.w),
        borderRadius: BorderRadius.circular(8.r),
      ),
      child: Container(
        width: 160.w,
        height: 160.h,
        padding: const EdgeInsets.all(8.0),

        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            if (iconPath != null)
              SvgGenImage.vec(iconPath).svg(
                width: 64.w,
                height: 64.h,
                colorFilter: ColorFilter.mode(color ?? AppColor.blueNormal, BlendMode.srcIn),
              ),
            SizedBox(height: 12.h),
            if (title != null)
              Text(
                title,
                style: AppFonts.yekan16Bold.copyWith(color: color ?? AppColor.blueNormal),
              ),
          ],
        ),
      ),
    ),
  );
}
