From 43018c753c945a631bcf2c5a4d028b4df826729b Mon Sep 17 00:00:00 2001 From: 240403 <240403@epvc.pt> Date: Sun, 24 May 2026 17:39:10 +0100 Subject: [PATCH] mudar nome no prefil --- .../presentation/pages/profile_edit_page.dart | 74 ++----------------- 1 file changed, 5 insertions(+), 69 deletions(-) diff --git a/lib/features/settings/presentation/pages/profile_edit_page.dart b/lib/features/settings/presentation/pages/profile_edit_page.dart index 1a5dd05..b8e2ec4 100644 --- a/lib/features/settings/presentation/pages/profile_edit_page.dart +++ b/lib/features/settings/presentation/pages/profile_edit_page.dart @@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart'; import '../../../../core/services/auth_service.dart'; import '../../../../core/theme/app_colors.dart'; import '../../../dashboard/presentation/pages/student_dashboard_page.dart'; +import '../../../dashboard/presentation/pages/teacher_dashboard_page.dart'; /// Profile edit page for settings class ProfileEditPage extends ConsumerStatefulWidget { @@ -16,8 +17,6 @@ class ProfileEditPage extends ConsumerStatefulWidget { class _ProfileEditPageState extends ConsumerState { final _formKey = GlobalKey(); final _nameController = TextEditingController(); - final _phoneController = TextEditingController(); - final _bioController = TextEditingController(); bool _isLoading = false; @override @@ -29,8 +28,6 @@ class _ProfileEditPageState extends ConsumerState { @override void dispose() { _nameController.dispose(); - _phoneController.dispose(); - _bioController.dispose(); super.dispose(); } @@ -60,6 +57,7 @@ class _ProfileEditPageState extends ConsumerState { // Clear cached user name so dashboard will reload with new name StudentDashboardPage.clearCachedUserName(); + TeacherDashboardPage.clearCachedUserName(); if (mounted) { ScaffoldMessenger.of(context).showSnackBar( @@ -108,8 +106,8 @@ class _ProfileEditPageState extends ConsumerState { end: Alignment.bottomRight, colors: [ 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.primary.withValues(alpha: 0.1), + Theme.of(context).colorScheme.secondary.withValues(alpha: 0.05), Theme.of(context).colorScheme.background, ], ), @@ -159,7 +157,7 @@ class _ProfileEditPageState extends ConsumerState { BoxShadow( color: Theme.of( context, - ).colorScheme.shadow.withOpacity(0.1), + ).colorScheme.shadow.withValues(alpha: 0.1), blurRadius: 10, offset: const Offset(0, 4), ), @@ -252,68 +250,6 @@ class _ProfileEditPageState extends ConsumerState { return null; }, ), - const SizedBox(height: 24), - - // Phone field (optional) - Text( - 'Telefone (opcional)', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: Theme.of(context).colorScheme.onSurface, - ), - ), - const SizedBox(height: 8), - TextFormField( - controller: _phoneController, - keyboardType: TextInputType.phone, - decoration: InputDecoration( - hintText: 'Introduza o seu telefone', - filled: true, - fillColor: Theme.of( - context, - ).colorScheme.surface, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide.none, - ), - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 12, - ), - ), - ), - const SizedBox(height: 24), - - // Bio field (optional) - Text( - 'Bio (opcional)', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: Theme.of(context).colorScheme.onSurface, - ), - ), - const SizedBox(height: 8), - TextFormField( - controller: _bioController, - maxLines: 3, - decoration: InputDecoration( - hintText: 'Conte um pouco sobre si', - filled: true, - fillColor: Theme.of( - context, - ).colorScheme.surface, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide.none, - ), - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 12, - ), - ), - ), const SizedBox(height: 32), // Save button