import 'package:flutter/material.dart'; import 'package:barber_app/core/theme/app_theme.dart'; class StatCard extends StatelessWidget { final String title; final String value; final IconData icon; final Color? iconColor; final String? subtitle; final VoidCallback? onTap; final bool isPrimary; // Destaque visual const StatCard({ super.key, required this.title, required this.value, required this.icon, this.iconColor, this.subtitle, this.onTap, this.isPrimary = false, }); @override Widget build(BuildContext context) { return GestureDetector( onTap: onTap, child: Container( height: 180, // Altura fixa para uniformidade e funcionamento do Spacer decoration: BoxDecoration( color: isPrimary ? AppColors.primaryColor : AppColors.surface, gradient: isPrimary ? AppColors.goldGradient : null, borderRadius: BorderRadius.circular(28), boxShadow: isPrimary ? [ BoxShadow( color: AppColors.primaryColor.withValues(alpha: 0.3), blurRadius: 25, offset: const Offset(0, 12), ), ] : [ BoxShadow( color: Colors.black.withValues(alpha: 0.2), blurRadius: 15, offset: const Offset(0, 8), ), ], border: Border.all( color: isPrimary ? Colors.white.withValues(alpha: 0.2) : AppColors.surfaceLight, width: 1, ), ), padding: const EdgeInsets.all(22), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( color: isPrimary ? Colors.black.withValues(alpha: 0.12) : (iconColor ?? AppColors.primaryColor).withValues( alpha: 0.08, ), borderRadius: BorderRadius.circular(16), ), child: Icon( icon, color: isPrimary ? Colors.black : (iconColor ?? AppColors.primaryColor), size: 22, ), ), if (onTap != null) Icon( Icons.arrow_forward_ios_rounded, color: isPrimary ? Colors.black.withValues(alpha: 0.4) : AppColors.textSecondary, size: 14, ), ], ), const Spacer(), FittedBox( fit: BoxFit.scaleDown, alignment: Alignment.centerLeft, child: Text( value, style: TextStyle( fontSize: 24, fontWeight: FontWeight.w900, color: isPrimary ? Colors.black : AppColors.textPrimary, fontFamily: 'Outfit', letterSpacing: -0.5, ), ), ), const SizedBox(height: 4), Text( title.toUpperCase(), overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( fontSize: 10, color: isPrimary ? Colors.black.withValues(alpha: 0.6) : AppColors.textSecondary, fontWeight: FontWeight.w800, letterSpacing: 1.2, ), ), ], ), ), ); } }