main
230404 2025-12-02 17:10:42 +00:00
parent 3feb73da3a
commit 606c8993a1
4 changed files with 193 additions and 5 deletions

View File

@ -0,0 +1,15 @@
import 'dart:async';
class HomeController {
Future<void> loadHomeData() async {
await Future.delayed(const Duration(milliseconds: 500));
}
void refreshData() {
loadHomeData();
}
List<String> getFilterOptions() {
return ['Últimos 7 dias', 'Últimos 30 dias', 'Temporada completa'];
}
}

View File

@ -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(),
);
}
}

174
lib/pages/home.dart Normal file
View File

@ -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<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
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: '',
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;
});
},
),
);
}
}

View File

@ -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});