57 lines
1.5 KiB
Dart
57 lines
1.5 KiB
Dart
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;
|
|
final String value;
|
|
|
|
const StatTile({
|
|
Key? key,
|
|
required this.icon,
|
|
required this.label,
|
|
required this.value,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
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,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|