login e register
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../controllers/register_controller.dart';
|
||||
import '../widgets/register_widgets.dart';
|
||||
import '../utils/size_extension.dart'; // 👇 O NOSSO SUPERPODER!
|
||||
|
||||
class RegisterPage extends StatefulWidget {
|
||||
const RegisterPage({super.key});
|
||||
@@ -10,39 +11,44 @@ class RegisterPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _RegisterPageState extends State<RegisterPage> {
|
||||
// Instancia o controller
|
||||
final RegisterController _controller = RegisterController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose(); // Limpa a memória ao sair
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text("Criar Conta")),
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Criar Conta", style: TextStyle(fontSize: 18 * context.sf, fontWeight: FontWeight.bold)),
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
),
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
padding: EdgeInsets.all(24.0 * context.sf),
|
||||
child: ListenableBuilder(
|
||||
listenable: _controller, // Ouve as mudanças (loading)
|
||||
listenable: _controller,
|
||||
builder: (context, child) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
"Junta-te à Equipa!",
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
|
||||
// Widgets Extraídos
|
||||
RegisterFormFields(controller: _controller),
|
||||
const SizedBox(height: 24),
|
||||
RegisterButton(controller: _controller),
|
||||
],
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(maxWidth: 450 * context.sf), // Mesma largura do Login
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const RegisterHeader(), // 🔥 Agora sim, usa o Header bonito!
|
||||
SizedBox(height: 30 * context.sf),
|
||||
|
||||
RegisterFormFields(controller: _controller),
|
||||
SizedBox(height: 24 * context.sf),
|
||||
|
||||
RegisterButton(controller: _controller),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user