78 lines
2.5 KiB
Dart
78 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:trainhub_flutter/core/constants/ui_constants.dart';
|
|
import 'package:trainhub_flutter/core/theme/app_colors.dart';
|
|
|
|
class AppStatCard extends StatelessWidget {
|
|
const AppStatCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.value,
|
|
required this.accentColor,
|
|
this.icon,
|
|
});
|
|
|
|
final String title;
|
|
final String value;
|
|
final Color accentColor;
|
|
final IconData? icon;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: AppColors.surfaceContainer,
|
|
borderRadius: UIConstants.cardBorderRadius,
|
|
border: Border.all(color: AppColors.border),
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: UIConstants.cardBorderRadius,
|
|
child: Row(
|
|
children: [
|
|
Container(width: 4, height: 72, color: accentColor),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: UIConstants.cardPadding,
|
|
vertical: UIConstants.spacing12,
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Text(
|
|
title.toUpperCase(),
|
|
style: GoogleFonts.jetBrainsMono(
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 1.2,
|
|
color: AppColors.textMuted,
|
|
),
|
|
),
|
|
const SizedBox(height: UIConstants.spacing4),
|
|
Text(
|
|
value,
|
|
style: GoogleFonts.jetBrainsMono(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.w700,
|
|
color: AppColors.textPrimary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
if (icon != null) Icon(icon, size: 20, color: accentColor),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|