95 lines
3.5 KiB
Dart
95 lines
3.5 KiB
Dart
// lib/screens/main_menu_screen.dart
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:kzeduca_app/screens/character_selection_screen.dart'; // Importa a tela de seleção
|
|
import 'package:kzeduca_app/screens/dashboard_screen.dart'; // Importa a tela do Dashboard
|
|
|
|
class MainMenuScreen extends StatelessWidget {
|
|
const MainMenuScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Stack(
|
|
children: [
|
|
// 1. Imagem de Fundo
|
|
// Este Container expande para cobrir toda a tela
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage('assets/images/splash.png'),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
|
|
// 2. O conteúdo principal (botões)
|
|
Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.end, // Alinha o conteúdo na parte inferior
|
|
children: [
|
|
// Adicionei um espaço para que os botões não fiquem colados na borda
|
|
const SizedBox(height: 50),
|
|
|
|
// Botão "Novo Jogo"
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => const CharacterSelectionScreen(),
|
|
),
|
|
);
|
|
},
|
|
style: ElevatedButton.styleFrom(
|
|
foregroundColor: Colors.white,
|
|
backgroundColor: const Color(0xFF8A2BE2),
|
|
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 15),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10), // Bordas arredondadas
|
|
),
|
|
),
|
|
child: const Text(
|
|
'Começar',
|
|
style: TextStyle(fontSize: 18),
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 20), // Espaço entre os botões
|
|
|
|
// Botão "Sair" que navega para DashboardScreen
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
// Navega para a DashboardScreen, substituindo a tela atual
|
|
Navigator.pushReplacement(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => const DashboardScreen(),
|
|
),
|
|
);
|
|
},
|
|
style: ElevatedButton.styleFrom(
|
|
foregroundColor: Colors.white,
|
|
backgroundColor: Colors.transparent, // Fundo transparente
|
|
elevation: 0, // Sem sombra
|
|
side: const BorderSide(color: Colors.white, width: 2), // Borda branca
|
|
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 15),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
),
|
|
child: const Text(
|
|
'Sair',
|
|
style: TextStyle(fontSize: 18),
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 50), // Espaço para não ficar colado na borda inferior
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |