96 lines
2.7 KiB
Dart
96 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../common/theme/theme.dart';
|
|
import '../../../components/spacer/spacer.dart';
|
|
|
|
class HomeStatsTile extends StatelessWidget {
|
|
final String title;
|
|
final String value;
|
|
final IconData icon;
|
|
final Color color;
|
|
final String subtitle;
|
|
const HomeStatsTile({
|
|
super.key,
|
|
required this.title,
|
|
required this.value,
|
|
required this.icon,
|
|
required this.color,
|
|
required this.subtitle,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.all(20),
|
|
decoration: BoxDecoration(
|
|
color: AppColor.white,
|
|
borderRadius: BorderRadius.circular(AppValue.radius),
|
|
border: Border.all(color: AppColor.border.withOpacity(0.5)),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: color.withOpacity(0.08),
|
|
blurRadius: 20,
|
|
offset: const Offset(0, 8),
|
|
spreadRadius: 0,
|
|
),
|
|
],
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
colors: [color.withOpacity(0.1), color.withOpacity(0.05)],
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
),
|
|
borderRadius: BorderRadius.circular(12),
|
|
border: Border.all(color: color.withOpacity(0.2), width: 1),
|
|
),
|
|
child: Icon(icon, color: color, size: 20),
|
|
),
|
|
],
|
|
),
|
|
const SpaceHeight(16),
|
|
FittedBox(
|
|
fit: BoxFit.scaleDown,
|
|
alignment: Alignment.centerLeft,
|
|
child: Text(
|
|
value,
|
|
style: AppStyle.xxl.copyWith(
|
|
fontWeight: FontWeight.w800,
|
|
color: AppColor.textPrimary,
|
|
letterSpacing: -0.5,
|
|
),
|
|
),
|
|
),
|
|
const SpaceHeight(4),
|
|
Text(
|
|
title,
|
|
style: AppStyle.md.copyWith(
|
|
fontSize: 13,
|
|
color: AppColor.textSecondary,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
const SpaceHeight(2),
|
|
Text(
|
|
subtitle,
|
|
style: AppStyle.xs.copyWith(
|
|
color: AppColor.textLight,
|
|
fontWeight: FontWeight.w400,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|