focar na tela de equipa
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:playmaker/controllers/register_controller.dart';
|
||||
import '../Controllers/register_controller.dart';
|
||||
import '../widgets/register_widgets.dart'; // Import dos novos widgets
|
||||
import '../widgets/register_widgets.dart';
|
||||
import 'home.dart';
|
||||
|
||||
class RegisterPage extends StatefulWidget {
|
||||
@@ -23,50 +22,54 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(backgroundColor: Colors.white, elevation: 0, foregroundColor: Colors.black),
|
||||
backgroundColor: Colors.white,
|
||||
// AppBar para poder voltar atrás
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
foregroundColor: Colors.black,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListenableBuilder(
|
||||
listenable: controller,
|
||||
builder: (context, child) {
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
children: [
|
||||
const RegisterHeader(), // Widget do Header
|
||||
const SizedBox(height: 40),
|
||||
|
||||
RegisterFormFields(controller: controller), // Widget dos Campos
|
||||
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// Botão de Finalizar
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFE74C3C),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
|
||||
),
|
||||
onPressed: controller.isLoading ? null : () async {
|
||||
final success = await controller.signUp();
|
||||
if (success && mounted) {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const HomeScreen()),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: controller.isLoading
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: const Text("Criar Conta", style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
return LayoutBuilder(
|
||||
// ... dentro do LayoutBuilder
|
||||
builder: (context, constraints) {
|
||||
final screenWidth = constraints.maxWidth;
|
||||
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
|
||||
width: screenWidth * 0.6,
|
||||
constraints: const BoxConstraints(minWidth: 320),
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const RegisterHeader(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
RegisterFormFields(controller: controller),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
RegisterButton(
|
||||
controller: controller,
|
||||
onRegisterSuccess: () {
|
||||
Navigator.pushAndRemoveUntil(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const HomeScreen()),
|
||||
(route) => false,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user