tentative de firebase

This commit is contained in:
2025-12-12 10:37:10 +00:00
parent bd89eba772
commit 8e179df1dc
15 changed files with 535 additions and 33 deletions

View File

@@ -2,9 +2,41 @@ import 'package:flutter/material.dart';
import 'package:playmaker/classe/home.config.dart';
import 'package:playmaker/grafico%20de%20pizza/grafico.dart';
class HomeScreen extends StatelessWidget {
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
int _selectedIndex = 0;
void _onItemSelected(int index) {
setState(() {
_selectedIndex = index;
});
// Navegação entre telas
switch (index) {
case 0:
// Já está na Home
break;
case 1:
print('Navegar para tela de Jogo');
Navigator.push(context, MaterialPageRoute(builder: (_) => GameScreen()));
break;
case 2:
print('Navegar para tela de Equipas');
// Navigator.push(context, MaterialPageRoute(builder: (_) => TeamsScreen()));
break;
case 3:
print('Navegar para tela de Status');
// Navigator.push(context, MaterialPageRoute(builder: (_) => StatusScreen()));
break;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -22,6 +54,7 @@ class HomeScreen extends StatelessWidget {
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Primeira linha com 2 cards
Row(
@@ -40,14 +73,14 @@ class HomeScreen extends StatelessWidget {
SizedBox(width: 20),
// Card 2 - Estatísticas de Futebol
// Card 2 - Estatísticas de Basquete (corrigido)
_buildStatCard(
title: 'Mais Assistências',
playerName: 'magic Johnson',
playerName: 'Magic Johnson',
statValue: '12.8',
statLabel: 'APG',
color: Colors.green[800]!,
icon: Icons.sports_soccer,
icon: Icons.sports_basketball, // Corrigido para basquete
isHighlighted: false,
),
],
@@ -59,21 +92,21 @@ class HomeScreen extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Card 3 - Estatísticas de Tênis
// Card 3 - Estatísticas de Basquete (corrigido)
_buildStatCard(
title: 'Mais Rebotes',
playerName: 'Denis Rodman',
playerName: 'Dennis Rodman',
statValue: '15.3',
statLabel: 'RPG',
color: Colors.purple[800]!,
icon: Icons.sports_tennis,
icon: Icons.sports_basketball, // Corrigido para basquete
isHighlighted: false,
),
SizedBox(width: 20),
// Card 4 - Estatísticas de Vôlei
PieChartCard(
// Card 4 - Gráfico
PieChartCard(
title: 'DESEMPENHO',
subtitle: 'Vitórias vs Derrotas',
backgroundColor: Colors.red[800]!,
@@ -83,10 +116,54 @@ class HomeScreen extends StatelessWidget {
),
],
),
SizedBox(height: 40),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Histórico de Jogos',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.grey[800],
),
),
),
],
),
),
),
// ⬇️⬇️⬇️ NAVIGATION BAR AQUI ⬇️⬇️⬇️
bottomNavigationBar: NavigationBar(
selectedIndex: _selectedIndex,
onDestinationSelected: _onItemSelected,
backgroundColor: Theme.of(context).colorScheme.surface,
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint,
elevation: 1,
height: 70,
destinations: const [
NavigationDestination(
icon: Icon(Icons.home_outlined),
selectedIcon: Icon(Icons.home_filled),
label: 'Home',
),
NavigationDestination(
icon: Icon(Icons.sports_soccer_outlined),
selectedIcon: Icon(Icons.sports_soccer),
label: 'Jogo',
),
NavigationDestination(
icon: Icon(Icons.people_outline),
selectedIcon: Icon(Icons.people),
label: 'Equipas',
),
NavigationDestination(
icon: Icon(Icons.insights_outlined),
selectedIcon: Icon(Icons.insights),
label: 'Status',
),
],
),
);
}
@@ -104,7 +181,7 @@ class HomeScreen extends StatelessWidget {
width: HomeConfig.cardwidthPadding,
height: HomeConfig.cardheightPadding,
child: Card(
elevation: isHighlighted ? 12 : 8,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: isHighlighted
@@ -122,13 +199,6 @@ class HomeScreen extends StatelessWidget {
color.withOpacity(0.7),
],
),
boxShadow: [
BoxShadow(
color: color.withOpacity(0.3),
blurRadius: 15,
spreadRadius: 2,
),
],
),
child: Padding(
padding: const EdgeInsets.all(20.0),
@@ -256,4 +326,5 @@ class HomeScreen extends StatelessWidget {
),
);
}
}
}