Bon checkpoint + Refactoring

This commit is contained in:
DahoudG
2024-11-08 20:30:23 +00:00
parent 19f6efa995
commit 1e888f41e8
21 changed files with 721 additions and 223 deletions

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import '../../../../core/constants/colors.dart';
/// [StatTile] affiche une statistique utilisateur avec une icône, un label et une valeur.
/// Ce composant inclut des animations et une traçabilité des interactions.
class StatTile extends StatelessWidget {
final IconData icon;
final String label;
@@ -15,17 +17,40 @@ class StatTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListTile(
leading: Icon(icon, color: AppColors.accentColor),
title: Text(label, style: const TextStyle(color: Colors.white)),
trailing: Text(
value,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
debugPrint("[LOG] Initialisation de StatTile pour la statistique : $label");
return TweenAnimationBuilder<double>(
duration: const Duration(milliseconds: 500),
tween: Tween<double>(begin: 0.9, end: 1.0),
curve: Curves.easeOutBack,
builder: (context, scale, child) {
return Transform.scale(
scale: scale,
child: ListTile(
leading: Icon(
icon,
color: AppColors.accentColor,
size: 28,
),
title: Text(
label,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
trailing: Text(
value,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
);
},
);
}
}