validação entre professor e aluno, criação de placeholder para a tela de professores e mudanças na firebase

This commit is contained in:
2026-05-08 16:37:36 +01:00
parent c821ce8e1e
commit 1b7b03034d
6 changed files with 461 additions and 73 deletions

View File

@@ -6,7 +6,9 @@ import '../../../../core/services/auth_service.dart';
import '../../../../shared/presentation/widgets/custom_notification.dart';
class SignupPage extends StatefulWidget {
const SignupPage({super.key});
final String? selectedRole;
const SignupPage({super.key, this.selectedRole});
@override
State<SignupPage> createState() => _SignupPageState();
@@ -19,7 +21,14 @@ class _SignupPageState extends State<SignupPage> {
final _passwordController = TextEditingController();
bool _isLoading = false;
bool _obscurePassword = true;
String _selectedRole = 'student'; // 'student' or 'teacher'
late String _selectedRole;
@override
void initState() {
super.initState();
// Usar role passado da tela anterior ou default 'student'
_selectedRole = widget.selectedRole ?? 'student';
}
@override
void dispose() {
@@ -338,61 +347,6 @@ class _SignupPageState extends State<SignupPage> {
return null;
},
),
const SizedBox(height: 16),
// Role selection
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Eu sou:',
style: TextStyle(
color: Color(0xFF2D3748),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
Row(
children: [
Expanded(
child: RadioListTile<String>(
title: const Text(
'Aluno',
style: TextStyle(fontSize: 14),
),
value: 'student',
groupValue: _selectedRole,
onChanged: (String? value) {
setState(() {
_selectedRole = value!;
});
},
activeColor: const Color(0xFF82C9BD),
contentPadding: EdgeInsets.zero,
),
),
Expanded(
child: RadioListTile<String>(
title: const Text(
'Professor',
style: TextStyle(fontSize: 14),
),
value: 'teacher',
groupValue: _selectedRole,
onChanged: (String? value) {
setState(() {
_selectedRole = value!;
});
},
activeColor: const Color(0xFF82C9BD),
contentPadding: EdgeInsets.zero,
),
),
],
),
],
),
const SizedBox(height: 24),
// Signup button
@@ -434,7 +388,7 @@ class _SignupPageState extends State<SignupPage> {
// Login link
GestureDetector(
onTap: () {
context.go('/login');
context.go('/login?role=$_selectedRole');
},
child: Text(
'Já tem conta? Entrar aqui',