Historico de quizzes e inicio de atualização da IA para leitura de pdfs de matemática (incompleto)
This commit is contained in:
@@ -13,22 +13,30 @@ class JoinClassPage extends ConsumerStatefulWidget {
|
||||
|
||||
class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
final _codeController = TextEditingController();
|
||||
final _nameController = TextEditingController();
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_codeController.dispose();
|
||||
_nameController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _joinClass() async {
|
||||
final code = _codeController.text.trim().toUpperCase();
|
||||
final customName = _nameController.text.trim();
|
||||
|
||||
if (code.isEmpty) {
|
||||
_showError('Insere o código da disciplina');
|
||||
return;
|
||||
}
|
||||
|
||||
if (customName.isEmpty) {
|
||||
_showError('Insere o nome da disciplina');
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
try {
|
||||
@@ -105,6 +113,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
currentUser.displayName ??
|
||||
currentUser.email?.split('@')[0] ??
|
||||
'Aluno',
|
||||
'customClassName': customName,
|
||||
'joinedAt': FieldValue.serverTimestamp(),
|
||||
});
|
||||
|
||||
@@ -201,7 +210,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Entrar numa Disciplina',
|
||||
'Adicionar uma Disciplina',
|
||||
style: TextStyle(
|
||||
color: colorScheme.onSurface,
|
||||
fontSize: 18,
|
||||
@@ -345,7 +354,14 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
_buildInstructionItem(
|
||||
context,
|
||||
'3.',
|
||||
'Clicar em "Entrar na Disciplina" para confirmar',
|
||||
'Escrever o nome da disciplina',
|
||||
colorScheme,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildInstructionItem(
|
||||
context,
|
||||
'4.',
|
||||
'Clicar em "Adicionar uma Disciplina" para confirmar',
|
||||
colorScheme,
|
||||
),
|
||||
],
|
||||
@@ -407,6 +423,53 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Campo de nome da disciplina
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.cardColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(
|
||||
color: colorScheme.outline.withOpacity(0.3),
|
||||
width: 1,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: isDark
|
||||
? Colors.black.withOpacity(0.2)
|
||||
: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: TextField(
|
||||
controller: _nameController,
|
||||
style: theme.textTheme.bodyLarge?.copyWith(
|
||||
color: colorScheme.onSurface,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Nome da disciplina',
|
||||
hintStyle: theme.textTheme.bodyLarge?.copyWith(
|
||||
color: colorScheme.onSurfaceVariant.withOpacity(
|
||||
0.5,
|
||||
),
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
prefixIcon: Icon(
|
||||
Icons.edit,
|
||||
color: colorScheme.primary,
|
||||
size: 24,
|
||||
),
|
||||
prefixIconConstraints: const BoxConstraints(
|
||||
minWidth: 48,
|
||||
minHeight: 48,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// Botão de entrar
|
||||
@@ -445,7 +508,7 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Entrar na Disciplina',
|
||||
'Adicionar uma Disciplina',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -540,26 +603,30 @@ class _JoinClassPageState extends ConsumerState<JoinClassPage> {
|
||||
children: [
|
||||
Icon(Icons.help_outline, color: colorScheme.primary),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Ajuda - Código da Disciplina',
|
||||
style: TextStyle(color: colorScheme.onSurface),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Ajuda - Código da Disciplina',
|
||||
style: TextStyle(color: colorScheme.onSurface),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'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),
|
||||
Text(
|
||||
'Se não tens o código, contacta o teu professor.',
|
||||
style: TextStyle(color: colorScheme.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'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),
|
||||
Text(
|
||||
'Se não tens o código, contacta o teu professor.',
|
||||
style: TextStyle(color: colorScheme.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
|
||||
Reference in New Issue
Block a user