MAJ0.1 accueil et historique

This commit is contained in:
qguillaume
2026-05-03 16:46:05 +02:00
parent 105eb1cab0
commit 5cc67228e4
2 changed files with 165 additions and 122 deletions

View File

@@ -1,9 +1,3 @@
/// Écran d'accueil - Dashboard principal de l'application.
///
/// Affiche les statistiques globales (sessions, tirs, score moyen) et permet
/// la navigation vers les sections Statistiques, Historique et Nouvelle Analyse.
library;
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../core/constants/app_constants.dart';
@@ -46,6 +40,13 @@ class _HomeScreenState extends State<HomeScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// --- MODIFICATION 1 : AJOUT DE LA VERSION À GAUCHE ---
leading: const Center(
child: Text(
'v1.0.2',
style: TextStyle(fontSize: 12, color: Colors.white70),
),
),
title: const Text('Bully'),
actions: [
IconButton(
@@ -94,7 +95,7 @@ class _HomeScreenState extends State<HomeScreen> {
Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: AppTheme.primaryColor.withValues(alpha: 0.1),
color: AppTheme.primaryColor.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
@@ -106,16 +107,16 @@ class _HomeScreenState extends State<HomeScreen> {
const SizedBox(height: 16),
Text(
'Analyse de Cibles',
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
),
style: Theme.of(
context,
).textTheme.headlineMedium?.copyWith(fontWeight: FontWeight.bold),
),
const SizedBox(height: 8),
Text(
'Scannez vos cibles et analysez vos performances',
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: AppTheme.textSecondary,
),
style: Theme.of(
context,
).textTheme.bodyLarge?.copyWith(color: AppTheme.textSecondary),
textAlign: TextAlign.center,
),
],
@@ -147,14 +148,15 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
Text(
'Statistiques',
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.bold,
),
style: Theme.of(
context,
).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.bold),
),
const SizedBox(height: 12),
// Première ligne de vignettes (Sessions et Tirs)
Row(
children: [
// --- BOUTON SESSIONS (Redirige vers Statistiques) ---
Expanded(
child: InkWell(
onTap: () => _navigateToStatistics(context),
@@ -168,7 +170,6 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
const SizedBox(width: 12),
// Ce bouton reste statique (ou tu peux ajouter une action)
Expanded(
child: StatsCard(
icon: Icons.gps_fixed,
@@ -179,10 +180,32 @@ class _HomeScreenState extends State<HomeScreen> {
),
],
),
const SizedBox(height: 12),
// --- MODIFICATION 2 : AJOUT DU GRAPHIQUE AU MILIEU ---
Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Container(
height: 150,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(AppConstants.borderRadius),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 4),
),
],
),
child: const Center(
child: Icon(Icons.show_chart, size: 50, color: Colors.grey),
),
),
),
// Deuxième ligne de vignettes (Historique et Meilleur)
Row(
children: [
// --- BOUTON SCORE MOYEN (Redirige vers Historique) ---
Expanded(
child: InkWell(
onTap: () => _navigateToHistory(context),
@@ -196,7 +219,6 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
const SizedBox(width: 12),
// Ce bouton reste statique
Expanded(
child: StatsCard(
icon: Icons.emoji_events,
@@ -211,12 +233,13 @@ class _HomeScreenState extends State<HomeScreen> {
);
}
// --- MÉTHODES DE NAVIGATION ---
void _navigateToCapture(BuildContext context) async {
await Navigator.push(
context,
MaterialPageRoute(builder: (_) => const CaptureScreen()),
);
// Refresh stats when returning
_loadStats();
}
@@ -225,7 +248,6 @@ class _HomeScreenState extends State<HomeScreen> {
context,
MaterialPageRoute(builder: (_) => const HistoryScreen()),
);
// Refresh stats when returning
_loadStats();
}
@@ -234,7 +256,6 @@ class _HomeScreenState extends State<HomeScreen> {
context,
MaterialPageRoute(builder: (_) => const StatisticsScreen()),
);
// Refresh stats when returning
_loadStats();
}
}