Muitas coisas e já me esqueci delas todas, cenas principalmente no dashboard do aluno bug fixes e etc
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../../../core/services/auth_service.dart';
|
||||
|
||||
/// Página para o aluno entrar numa turma usando o código
|
||||
/// Página para o aluno entrar numa disciplina usando o código
|
||||
class JoinClassPage extends ConsumerStatefulWidget {
|
||||
const JoinClassPage({super.key});
|
||||
|
||||
@@ -25,7 +25,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
final code = _codeController.text.trim().toUpperCase();
|
||||
|
||||
if (code.isEmpty) {
|
||||
_showError('Insere o código da turma');
|
||||
_showError('Insere o código da disciplina');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
final userRole = await AuthService.getUserRole(currentUser.uid);
|
||||
if (userRole != 'student') {
|
||||
setState(() => _isLoading = false);
|
||||
_showError('Apenas alunos podem entrar em turmas por código.');
|
||||
_showError('Apenas alunos podem entrar em disciplinas por código.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
currentUser.uid,
|
||||
);
|
||||
|
||||
// Procurar turma pelo código
|
||||
// Procurar disciplina pelo código
|
||||
final classQuery = await FirebaseFirestore.instance
|
||||
.collection('classes')
|
||||
.where('code', isEqualTo: code)
|
||||
@@ -62,7 +62,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
|
||||
if (classQuery.docs.isEmpty) {
|
||||
setState(() => _isLoading = false);
|
||||
_showError('Código de turma inválido');
|
||||
_showError('Código de disciplina inválido');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,20 +70,20 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
final classId = classDoc.id;
|
||||
final classSchoolClassId = classDoc.data()['schoolClassId'] as String?;
|
||||
|
||||
// Verificar se o aluno está autorizado a entrar nesta turma
|
||||
// Verificar se o aluno está autorizado a entrar nesta disciplina
|
||||
// O schoolClassId do aluno deve corresponder ao schoolClassId da disciplina
|
||||
if (studentSchoolClassId == null ||
|
||||
classSchoolClassId == null ||
|
||||
studentSchoolClassId != classSchoolClassId) {
|
||||
setState(() => _isLoading = false);
|
||||
_showError(
|
||||
'Não tens permissão para entrar nesta turma.\n'
|
||||
'Não tens permissão para entrar nesta disciplina.\n'
|
||||
'O teu professor ainda não te adicionou a esta disciplina.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Verificar se já está inscrito nesta turma
|
||||
// Verificar se já está inscrito nesta disciplina
|
||||
final existingEnrollment = await FirebaseFirestore.instance
|
||||
.collection('enrollments')
|
||||
.where('classId', isEqualTo: classId)
|
||||
@@ -93,7 +93,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
|
||||
if (existingEnrollment.docs.isNotEmpty) {
|
||||
setState(() => _isLoading = false);
|
||||
_showError('Já estás inscrito nesta turma');
|
||||
_showError('Já estás inscrito nesta disciplina');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
children: [
|
||||
Icon(Icons.check_circle, color: Colors.white),
|
||||
const SizedBox(width: 8),
|
||||
const Text('Entraste na turma com sucesso!'),
|
||||
const Text('Entraste na disciplina com sucesso!'),
|
||||
],
|
||||
),
|
||||
backgroundColor: colorScheme.primary,
|
||||
@@ -136,7 +136,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
}
|
||||
} catch (e) {
|
||||
setState(() => _isLoading = false);
|
||||
_showError('Erro ao entrar na turma: $e');
|
||||
_showError('Erro ao entrar na disciplina: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Entrar numa Turma',
|
||||
'Entrar numa Disciplina',
|
||||
style: TextStyle(
|
||||
color: colorScheme.onSurface,
|
||||
fontSize: 18,
|
||||
@@ -272,7 +272,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
'Insere o código da turma',
|
||||
'Insere o código da disciplina',
|
||||
style: theme.textTheme.headlineSmall
|
||||
?.copyWith(
|
||||
color: colorScheme.onSurface,
|
||||
@@ -331,7 +331,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
_buildInstructionItem(
|
||||
context,
|
||||
'1.',
|
||||
'Pedir ao professor o código da turma',
|
||||
'Pedir ao professor o código da disciplina',
|
||||
colorScheme,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -345,7 +345,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
_buildInstructionItem(
|
||||
context,
|
||||
'3.',
|
||||
'Clicar em "Entrar na Turma" para confirmar',
|
||||
'Clicar em "Entrar na Disciplina" para confirmar',
|
||||
colorScheme,
|
||||
),
|
||||
],
|
||||
@@ -445,7 +445,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Entrar na Turma',
|
||||
'Entrar na Disciplina',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -541,7 +541,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
Icon(Icons.help_outline, color: colorScheme.primary),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Ajuda - Código da Turma',
|
||||
'Ajuda - Código da Disciplina',
|
||||
style: TextStyle(color: colorScheme.onSurface),
|
||||
),
|
||||
],
|
||||
@@ -551,7 +551,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'O código da turma é um código único de 6 caracteres que o teu professor cria para cada turma.',
|
||||
'O código da disciplina é um código único de 6 caracteres que o teu professor cria para cada disciplina.',
|
||||
style: TextStyle(color: colorScheme.onSurfaceVariant),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Reference in New Issue
Block a user