52 lines
1.4 KiB
Dart
52 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:trainhub_flutter/core/constants/ui_constants.dart';
|
|
import 'package:trainhub_flutter/core/theme/app_colors.dart';
|
|
import 'package:trainhub_flutter/presentation/common/widgets/app_stat_card.dart';
|
|
|
|
class StatCardsRow extends StatelessWidget {
|
|
const StatCardsRow({
|
|
super.key,
|
|
required this.completed,
|
|
required this.total,
|
|
});
|
|
|
|
final int completed;
|
|
final int total;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final progress = total == 0 ? 0 : (completed / total * 100).round();
|
|
|
|
return Row(
|
|
children: [
|
|
Expanded(
|
|
child: AppStatCard(
|
|
title: 'Completed',
|
|
value: '$completed',
|
|
icon: Icons.check_circle_outline,
|
|
accentColor: AppColors.success,
|
|
),
|
|
),
|
|
const SizedBox(width: UIConstants.spacing16),
|
|
Expanded(
|
|
child: AppStatCard(
|
|
title: 'Total Workouts',
|
|
value: '$total',
|
|
icon: Icons.list_alt,
|
|
accentColor: AppColors.info,
|
|
),
|
|
),
|
|
const SizedBox(width: UIConstants.spacing16),
|
|
Expanded(
|
|
child: AppStatCard(
|
|
title: 'Progress',
|
|
value: '$progress%',
|
|
icon: Icons.trending_up,
|
|
accentColor: AppColors.purple,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|