From 606c8993a16eeb0eae528efd8752f287f8a8960d Mon Sep 17 00:00:00 2001 From: 230404 <230404@epvc.pt> Date: Tue, 2 Dec 2025 17:10:42 +0000 Subject: [PATCH] dyerser --- lib/controllers/home_controller.dart | 15 +++ lib/main.dart | 5 +- lib/pages/home.dart | 174 +++++++++++++++++++++++++++ lib/{ => pages}/login.dart | 4 +- 4 files changed, 193 insertions(+), 5 deletions(-) create mode 100644 lib/controllers/home_controller.dart create mode 100644 lib/pages/home.dart rename lib/{ => pages}/login.dart (96%) diff --git a/lib/controllers/home_controller.dart b/lib/controllers/home_controller.dart new file mode 100644 index 0000000..eb43158 --- /dev/null +++ b/lib/controllers/home_controller.dart @@ -0,0 +1,15 @@ +import 'dart:async'; + +class HomeController { + Future loadHomeData() async { + await Future.delayed(const Duration(milliseconds: 500)); + } + + void refreshData() { + loadHomeData(); + } + + List getFilterOptions() { + return ['Últimos 7 dias', 'Últimos 30 dias', 'Temporada completa']; + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 80b4aa6..7a5b4fa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'login.dart'; +import 'pages/login.dart'; void main() { runApp(const MyApp()); @@ -18,8 +18,7 @@ class MyApp extends StatelessWidget { ), useMaterial3: true, ), - home: const LoginPage(), - debugShowCheckedModeBanner: false, + home: LoginPage(), ); } } \ No newline at end of file diff --git a/lib/pages/home.dart b/lib/pages/home.dart new file mode 100644 index 0000000..137fd5c --- /dev/null +++ b/lib/pages/home.dart @@ -0,0 +1,174 @@ +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; + }); + }, + ), + ); + } +} \ No newline at end of file diff --git a/lib/login.dart b/lib/pages/login.dart similarity index 96% rename from lib/login.dart rename to lib/pages/login.dart index bc7903a..8bd7b90 100644 --- a/lib/login.dart +++ b/lib/pages/login.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'widgets/login_widgets.dart'; -import '../Controllers/login_controller.dart'; +import '../widgets/login_widgets.dart'; +import '../../Controllers/login_controller.dart'; class LoginPage extends StatefulWidget { const LoginPage({super.key});