This commit is contained in:
51
lib/presentation/home/widgets/stat_cards_row.dart
Normal file
51
lib/presentation/home/widgets/stat_cards_row.dart
Normal file
@@ -0,0 +1,51 @@
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user