50 lines
1.2 KiB
Dart
50 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../core/theme.dart';
|
|
import '../atoms/bouncy_tap.dart';
|
|
|
|
class StatCard extends StatelessWidget {
|
|
final String label;
|
|
final String value;
|
|
final Color? valueColor;
|
|
final VoidCallback? onTap;
|
|
|
|
const StatCard({
|
|
Key? key,
|
|
required this.label,
|
|
required this.value,
|
|
this.valueColor,
|
|
this.onTap,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BouncyTap(
|
|
onPressed: onTap,
|
|
scaleDown: 0.98,
|
|
child: Container(
|
|
padding: const EdgeInsets.all(AppTheme.spacingMd),
|
|
decoration: BoxDecoration(
|
|
color: AppTheme.bgCard,
|
|
borderRadius: BorderRadius.circular(AppTheme.radiusMd),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
label,
|
|
style: AppTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 4),
|
|
Text(
|
|
value,
|
|
style: AppTheme.heading3.copyWith(
|
|
color: valueColor ?? AppTheme.textPrimary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|