dyerser
This commit is contained in:
174
lib/pages/home.dart
Normal file
174
lib/pages/home.dart
Normal 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: '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;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
79
lib/pages/login.dart
Normal file
79
lib/pages/login.dart
Normal file
@@ -0,0 +1,79 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../widgets/login_widgets.dart';
|
||||
import '../../Controllers/login_controller.dart';
|
||||
|
||||
class LoginPage extends StatefulWidget {
|
||||
const LoginPage({super.key});
|
||||
|
||||
@override
|
||||
State<LoginPage> createState() => _LoginPageState();
|
||||
}
|
||||
|
||||
class _LoginPageState extends State<LoginPage> {
|
||||
final LoginController controller = LoginController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final screenWidth = constraints.maxWidth;
|
||||
final screenHeight = constraints.maxHeight;
|
||||
|
||||
return Center(
|
||||
child: Container(
|
||||
width: screenWidth > 800 ? 600.0 :
|
||||
screenWidth > 600 ? 500.0 : 400.0,
|
||||
height: screenHeight, // ← USA A ALTURA TOTAL
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center, // ← CENTRALIZA VERTICALMENTE
|
||||
children: [
|
||||
const Expanded( // ← EXPANDE PARA USAR ESPAÇO
|
||||
flex: 2,
|
||||
child: SizedBox(),
|
||||
),
|
||||
|
||||
const BasketTrackHeader(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
LoginFormFields(controller: controller),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
LoginButton(
|
||||
controller: controller,
|
||||
onLoginSuccess: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Login bem-sucedido!'),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
const CreateAccountButton(),
|
||||
|
||||
const Expanded( // ← EXPANDE PARA USAR ESPAÇO
|
||||
flex: 3,
|
||||
child: SizedBox(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user