import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:tacban/assets/theme/colors.dart';
import 'package:tacban/src/app/home/screens/relatorio_screen.dart';

class CardInfoDetailWidget extends StatelessWidget {
  final String svg;
  final String title;
  final String subTitle;
  final GestureTapCallback? onTap;
  const CardInfoDetailWidget({super.key, required this.subTitle, required this.onTap, required this.svg, required this.title});

  @override
  Widget build(BuildContext context) {
    Radius radius = const Radius.circular(15);
    return Expanded(
      child: InkWell(
        onTap: (){
          context.push(RelatorioScreen.path);
        },
        radius: 0,
        child: Container(
          height: 200,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(18),
            boxShadow: [
              BoxShadow(
                color: AppColorLight.primaryColor,
                spreadRadius: 0,
                blurRadius: 1,
                blurStyle: BlurStyle.outer
              )
            ]
          ),
          child: Column(
            // mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ClipRRect(
                borderRadius: BorderRadius.only(
                  topLeft: radius,
                  topRight: radius
                ),
                child: SizedBox(
                  height: 140,
                  child: Image.asset(
                    svg,
                    fit: BoxFit.fill
                  )
                ),
              ),
              const SizedBox(height: 10),
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 10),
                child: Row(
                  children: [
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        Text(title,
                        textAlign: TextAlign.start,
                          style: Theme.of(context).textTheme.bodySmall?.copyWith(
                            fontWeight: FontWeight.bold,
                            color: AppColorLight.primaryColor,
                            fontSize: 15
                          ),
                        ),
                        Text(subTitle,
                          style: Theme.of(context).textTheme.bodySmall?.copyWith(
                            fontWeight: FontWeight.w100,
                            fontSize: 12
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              )
            ],
          ),
        ),
      )
    );
  }
}