- Dark / light mode a funcionar no lado do aluno

- Atualização dos ficheiros markdown.
This commit is contained in:
2026-05-14 22:07:03 +01:00
parent 55ec2521cf
commit 62b9a107bc
30 changed files with 2582 additions and 1839 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../../../../core/theme/app_colors.dart';
/// Help page with user guides
class HelpPage extends StatelessWidget {
@@ -17,17 +16,17 @@ class HelpPage extends StatelessWidget {
},
child: Scaffold(
body: Container(
decoration: const BoxDecoration(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF82C9BD),
Color(0xFF7BA89C),
Color(0xFFF68D2D),
Color(0xFFF8F9FA),
Theme.of(context).colorScheme.primary,
Theme.of(context).colorScheme.primary.withOpacity(0.9),
Theme.of(context).colorScheme.secondary,
Theme.of(context).colorScheme.background,
],
stops: [0.0, 0.2, 0.6, 1.0],
stops: const [0.0, 0.2, 0.6, 1.0],
),
),
child: SafeArea(
@@ -39,14 +38,17 @@ class HelpPage extends StatelessWidget {
child: Row(
children: [
IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.white),
icon: Icon(
Icons.arrow_back,
color: Theme.of(context).colorScheme.onPrimary,
),
onPressed: () => context.pop(),
),
const Expanded(
Expanded(
child: Text(
'Ajuda e Suporte',
style: TextStyle(
color: Colors.white,
color: Theme.of(context).colorScheme.onPrimary,
fontSize: 24,
fontWeight: FontWeight.bold,
),
@@ -62,6 +64,7 @@ class HelpPage extends StatelessWidget {
child: Column(
children: [
_buildGuideCard(
context: context,
icon: Icons.school,
title: 'Como usar o AI Tutor',
description:
@@ -70,6 +73,7 @@ class HelpPage extends StatelessWidget {
),
const SizedBox(height: 16),
_buildGuideCard(
context: context,
icon: Icons.quiz,
title: 'Como fazer quizzes',
description:
@@ -78,6 +82,7 @@ class HelpPage extends StatelessWidget {
),
const SizedBox(height: 16),
_buildGuideCard(
context: context,
icon: Icons.trending_up,
title: 'Ver o seu progresso',
description:
@@ -86,6 +91,7 @@ class HelpPage extends StatelessWidget {
),
const SizedBox(height: 16),
_buildGuideCard(
context: context,
icon: Icons.settings,
title: 'Configurações da app',
description:
@@ -97,11 +103,13 @@ class HelpPage extends StatelessWidget {
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
color: Theme.of(
context,
).colorScheme.shadow.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 4),
),
@@ -110,34 +118,40 @@ class HelpPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Text(
'Perguntas Frequentes',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: Theme.of(
context,
).colorScheme.onSurface,
),
),
const SizedBox(height: 16),
_buildFAQItem(
context: context,
question: 'Como posso alterar a minha senha?',
answer:
'Pode alterar a sua senha através da secção de segurança nas definições.',
),
const SizedBox(height: 12),
_buildFAQItem(
context: context,
question: 'Os meus dados estão seguros?',
answer:
'Sim, utilizamos encriptação de ponta a ponta para proteger todos os seus dados.',
),
const SizedBox(height: 12),
_buildFAQItem(
context: context,
question: 'Posso usar a app offline?',
answer:
'Algumas funcionalidades estão disponíveis offline, mas para o AI Tutor necessita de conexão à internet.',
),
const SizedBox(height: 12),
_buildFAQItem(
context: context,
question: 'Como contactar o suporte?',
answer:
'Pode contactar-nos através do email suporte@teachit.com.',
@@ -150,11 +164,13 @@ class HelpPage extends StatelessWidget {
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
color: Theme.of(
context,
).colorScheme.shadow.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 4),
),
@@ -163,20 +179,24 @@ class HelpPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Text(
'Ainda precisa de ajuda?',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: Theme.of(
context,
).colorScheme.onSurface,
),
),
const SizedBox(height: 8),
const Text(
Text(
'A nossa equipa de suporte está disponível para ajudar.',
style: TextStyle(
fontSize: 14,
color: AppColors.textSecondary,
color: Theme.of(
context,
).colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 16),
@@ -187,8 +207,12 @@ class HelpPage extends StatelessWidget {
icon: const Icon(Icons.email),
label: const Text('Contactar Suporte'),
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primaryTeal,
foregroundColor: Colors.white,
backgroundColor: Theme.of(
context,
).colorScheme.primary,
foregroundColor: Theme.of(
context,
).colorScheme.onPrimary,
),
),
],
@@ -207,6 +231,7 @@ class HelpPage extends StatelessWidget {
}
Widget _buildGuideCard({
required BuildContext context,
required IconData icon,
required String title,
required String description,
@@ -215,11 +240,11 @@ class HelpPage extends StatelessWidget {
return Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
color: Theme.of(context).colorScheme.shadow.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 4),
),
@@ -234,12 +259,19 @@ class HelpPage extends StatelessWidget {
width: 50,
height: 50,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [Color(0xFF82C9BD), Color(0xFF6BA8A0)],
gradient: LinearGradient(
colors: [
Theme.of(context).colorScheme.primary,
Theme.of(context).colorScheme.primary.withOpacity(0.8),
],
),
borderRadius: BorderRadius.circular(25),
),
child: Icon(icon, color: Colors.white, size: 24),
child: Icon(
icon,
color: Theme.of(context).colorScheme.onPrimary,
size: 24,
),
),
const SizedBox(width: 16),
Expanded(
@@ -248,38 +280,45 @@ class HelpPage extends StatelessWidget {
children: [
Text(
title,
style: const TextStyle(
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: Theme.of(context).colorScheme.onSurface,
),
),
const SizedBox(height: 4),
Text(
description,
style: const TextStyle(
style: TextStyle(
fontSize: 12,
color: AppColors.textSecondary,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
),
),
const Icon(Icons.chevron_right, color: AppColors.iconInactive),
Icon(
Icons.chevron_right,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
],
),
),
);
}
Widget _buildFAQItem({required String question, required String answer}) {
Widget _buildFAQItem({
required BuildContext context,
required String question,
required String answer,
}) {
return ExpansionTile(
title: Text(
question,
style: const TextStyle(
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
color: Theme.of(context).colorScheme.onSurface,
),
),
children: [
@@ -287,9 +326,9 @@ class HelpPage extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Text(
answer,
style: const TextStyle(
style: TextStyle(
fontSize: 13,
color: AppColors.textSecondary,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),

View File

@@ -98,17 +98,16 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
},
child: Scaffold(
body: Container(
decoration: const BoxDecoration(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF82C9BD),
Color(0xFF7BA89C),
Color(0xFFF68D2D),
Color(0xFFF8F9FA),
Theme.of(context).colorScheme.background,
Theme.of(context).colorScheme.primary.withOpacity(0.1),
Theme.of(context).colorScheme.secondary.withOpacity(0.05),
Theme.of(context).colorScheme.background,
],
stops: [0.0, 0.2, 0.6, 1.0],
),
),
child: SafeArea(
@@ -143,11 +142,13 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
child: Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Colors.white,
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
color: Theme.of(
context,
).colorScheme.shadow.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 4),
),
@@ -181,10 +182,23 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
),
),
const SizedBox(height: 16),
Text(
user?.displayName ?? 'Utilizador',
style: TextStyle(
color: Theme.of(
context,
).colorScheme.onSurface,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 4),
Text(
user?.email ?? '',
style: const TextStyle(
color: AppColors.textSecondary,
style: TextStyle(
color: Theme.of(
context,
).colorScheme.onSurfaceVariant,
fontSize: 14,
),
),
@@ -194,12 +208,12 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
const SizedBox(height: 32),
// Name field
const Text(
Text(
'Nome',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: Theme.of(context).colorScheme.onSurface,
),
),
const SizedBox(height: 8),
@@ -208,7 +222,9 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
decoration: InputDecoration(
hintText: 'Introduza o seu nome',
filled: true,
fillColor: AppColors.background,
fillColor: Theme.of(
context,
).colorScheme.surface,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide.none,
@@ -228,12 +244,12 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
const SizedBox(height: 24),
// Phone field (optional)
const Text(
Text(
'Telefone (opcional)',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: Theme.of(context).colorScheme.onSurface,
),
),
const SizedBox(height: 8),
@@ -243,7 +259,9 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
decoration: InputDecoration(
hintText: 'Introduza o seu telefone',
filled: true,
fillColor: AppColors.background,
fillColor: Theme.of(
context,
).colorScheme.surface,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide.none,
@@ -257,12 +275,12 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
const SizedBox(height: 24),
// Bio field (optional)
const Text(
Text(
'Bio (opcional)',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: AppColors.textPrimary,
color: Theme.of(context).colorScheme.onSurface,
),
),
const SizedBox(height: 8),
@@ -272,7 +290,9 @@ class _ProfileEditPageState extends ConsumerState<ProfileEditPage> {
decoration: InputDecoration(
hintText: 'Conte um pouco sobre si',
filled: true,
fillColor: AppColors.background,
fillColor: Theme.of(
context,
).colorScheme.surface,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide.none,

View File

@@ -29,17 +29,21 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
},
child: Scaffold(
body: Container(
decoration: const BoxDecoration(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF82C9BD),
Color(0xFF7BA89C),
Color(0xFFF68D2D),
Color(0xFFF8F9FA),
],
stops: [0.0, 0.2, 0.6, 1.0],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: themeMode == ThemeMode.light
? [
const Color(0xFFD4E8E8),
const Color(0xFFE8D4C0),
const Color(0xFFD8E0E8),
]
: [
Theme.of(context).colorScheme.primary.withOpacity(0.1),
Theme.of(context).colorScheme.secondary.withOpacity(0.05),
Theme.of(context).colorScheme.background,
],
),
),
child: SafeArea(
@@ -54,11 +58,11 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
icon: const Icon(Icons.arrow_back, color: Colors.white),
onPressed: () => context.go('/student-dashboard'),
),
const Expanded(
Expanded(
child: Text(
'Configurações',
style: TextStyle(
color: Colors.white,
color: Theme.of(context).colorScheme.onSurface,
fontSize: 24,
fontWeight: FontWeight.bold,
),
@@ -187,19 +191,23 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: isDark ? Colors.white70 : AppColors.textSecondary,
color: isDark
? Colors.white70
: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
Container(
decoration: BoxDecoration(
color: isDark ? Colors.grey[800] : AppColors.surface,
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 2,
offset: const Offset(0, 1),
color: Theme.of(
context,
).colorScheme.onSurfaceVariant.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
@@ -220,17 +228,17 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
leading: const Icon(Icons.palette, color: AppColors.primaryTeal),
title: Text(
'Tema',
style: TextStyle(color: isDark ? Colors.white : AppColors.textPrimary),
style: TextStyle(
color: isDark
? Colors.white
: Theme.of(context).colorScheme.onSurface,
),
),
subtitle: Text(
isDarkModeAvailable
? 'Atual: ${_getThemeModeString(currentTheme)}'
: 'Light Mode (padrão)',
style: TextStyle(
color: isDarkModeAvailable
? (isDark ? Colors.white70 : AppColors.textSecondary)
: AppColors.textHint,
),
style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
),
trailing: isDarkModeAvailable
? DropdownButton<ThemeMode>(
@@ -255,7 +263,10 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
),
],
)
: const Icon(Icons.lock, color: AppColors.textHint),
: Icon(
Icons.lock,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
);
}
@@ -283,12 +294,18 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
leading: const Icon(Icons.notifications, color: AppColors.primaryTeal),
title: Text(
title,
style: TextStyle(color: isDark ? Colors.white : AppColors.textPrimary),
style: TextStyle(
color: isDark
? Colors.white
: Theme.of(context).colorScheme.onSurface,
),
),
subtitle: Text(
subtitle,
style: TextStyle(
color: isDark ? Colors.white70 : AppColors.textSecondary,
color: isDark
? Colors.white70
: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
trailing: Switch(
@@ -312,15 +329,24 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
leading: Icon(icon, color: AppColors.primaryTeal),
title: Text(
title,
style: TextStyle(color: isDark ? Colors.white : AppColors.textPrimary),
style: TextStyle(
color: isDark
? Colors.white
: Theme.of(context).colorScheme.onSurface,
),
),
subtitle: Text(
subtitle,
style: TextStyle(
color: isDark ? Colors.white70 : AppColors.textSecondary,
color: isDark
? Colors.white70
: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
trailing: const Icon(Icons.chevron_right, color: AppColors.iconInactive),
trailing: Icon(
Icons.chevron_right,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
onTap: onTap,
);
}
@@ -336,12 +362,18 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
leading: Icon(icon, color: AppColors.primaryTeal),
title: Text(
title,
style: TextStyle(color: isDark ? Colors.white : AppColors.textPrimary),
style: TextStyle(
color: isDark
? Colors.white
: Theme.of(context).colorScheme.onSurface,
),
),
subtitle: Text(
subtitle,
style: TextStyle(
color: isDark ? Colors.white70 : AppColors.textSecondary,
color: isDark
? Colors.white70
: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
);