import 'package:flutter/material.dart'; import 'widgets/player_stat_card.dart'; import 'widgets/wins_losses_chart.dart'; import 'widgets/recent_game_card.dart'; import 'widgets/game_highlights.dart'; import 'widgets/bottom_nav_bar.dart'; import '../controllers/home_controller.dart'; class Home extends StatefulWidget { const Home({super.key}); @override State createState() => _HomeState(); } class _HomeState extends State { final HomeController _controller = HomeController(); int _currentIndex = 0; @override void initState() { super.initState(); _controller.loadHomeData(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: const Text( 'Home', style: TextStyle( fontSize: 24, fontWeight: FontWeight.bold, color: Colors.black, ), ), backgroundColor: Colors.white, elevation: 0, centerTitle: true, ), body: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ // Team Header Padding( padding: const EdgeInsets.only(top: 8.0, bottom: 16.0), child: Text( 'TEAM A', style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, color: Colors.grey[700], ), ), ), // Best Players Section const Text( 'Melhores Jogadores', style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black, ), ), const SizedBox(height: 12), // Player Stats Cards Row( children: [ Expanded( child: PlayerStatCard( title: 'Mais Pontos', playerName: 'Michael Jordan', statValue: '34.5', statType: 'PPG', icon: Icons.sports_basketball, color: Colors.blue, ), ), const SizedBox(width: 12), Expanded( child: PlayerStatCard( title: 'Mais Assistências', playerName: 'Magic Johnson', statValue: '12.8', statType: 'APG', icon: Icons.share, color: Colors.green, ), ), const SizedBox(width: 12), Expanded( child: PlayerStatCard( title: 'Mais Rebotes', playerName: 'Dennis Rodman', statValue: '15.3', statType: 'RPG', icon: Icons.vertical_align_center, color: Colors.orange, ), ), ], ), const SizedBox(height: 24), // Wins vs Losses WinsLossesChart( wins: 12, losses: 5, totalGames: 17, ), const SizedBox(height: 24), // Recent History const Text( 'Histórico Recente', style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black, ), ), const SizedBox(height: 12), RecentGameCard( teamA: 'TEAM A', teamB: 'TEAM B', scoreA: 91, scoreB: 88, quarter: '2º', timeLeft: '10:00', date: '13/06/25', ), const SizedBox(height: 24), // Game Highlights const Text( 'Destaques do Jogo', style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black, ), ), const SizedBox(height: 12), GameHighlights( players: [ PlayerHighlight(name: 'Fred', stat: '13,0 rebotes'), PlayerHighlight(name: 'Afonso', stat: '20,0 pontos'), ], ), const SizedBox(height: 20), ], ), ), ), bottomNavigationBar: BottomNavBar( currentIndex: _currentIndex, onTap: (index) { setState(() { _currentIndex = index; }); }, ), ); } }