Files
tm_app/lib/home/statistics_card.dart
T
2025-08-03 09:44:43 +03:30

74 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import '../size_config.dart';
class StatisticsCard extends StatelessWidget {
const StatisticsCard({
super.key,
required this.backgroundColor,
required this.iconPath,
required this.title,
required this.amount,
required this.textColor,
required this.onTap,
required this.enableTap,
});
final Color backgroundColor;
final String iconPath;
final String title;
final String amount;
final Color textColor;
final VoidCallback onTap;
final bool enableTap;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: enableTap ? onTap : null,
child: Container(
width: 178.0.w(),
height: 148.0.h(),
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(8),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(iconPath),
SizedBox(height: 4.0.h()),
Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.bold,
color: Color(0xFF777777),
),
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
amount,
style: TextStyle(
fontSize: 24.0.sp(),
fontWeight: FontWeight.bold,
color: textColor,
),
),
enableTap
? SvgPicture.asset('assets/icons/arrow-right.svg')
: SizedBox(),
],
),
],
),
),
);
}
}