From 339f7e17625d106e577b0e4f69b754edb91014eb Mon Sep 17 00:00:00 2001 From: sBubshait Date: Tue, 5 Aug 2025 11:12:03 +0300 Subject: [PATCH] feat: restructure the settings page --- frontend/lib/screens/pages/profile_page.dart | 112 ++++++++++--------- 1 file changed, 61 insertions(+), 51 deletions(-) diff --git a/frontend/lib/screens/pages/profile_page.dart b/frontend/lib/screens/pages/profile_page.dart index 2b03125..5ee69c1 100644 --- a/frontend/lib/screens/pages/profile_page.dart +++ b/frontend/lib/screens/pages/profile_page.dart @@ -688,6 +688,64 @@ class _SettingsPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + 'Your Preferences', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + color: Color(0xFF6A4C93), + ), + ), + SizedBox(height: 16), + + Container( + width: double.infinity, + height: 56, + child: ElevatedButton.icon( + onPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => EditProfileScreen(userData: userData), + ), + ), + icon: Icon(Icons.edit, size: 20), + label: Text('Profile'), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF6A4C93), + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + padding: EdgeInsets.symmetric(horizontal: 16), + ), + ), + ), + + SizedBox(height: 16), + + Container( + width: double.infinity, + height: 56, + child: ElevatedButton.icon( + onPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => NotificationsSettingsScreen(), + ), + ), + icon: Icon(Icons.notifications_outlined, size: 20), + label: Text('Notifications'), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF6A4C93), + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + padding: EdgeInsets.symmetric(horizontal: 16), + ), + ), + ), + + SizedBox(height: 32), + if (!isLoadingUser && _isAdmin) ...[ Text( 'Admin Tools', @@ -730,28 +788,6 @@ class _SettingsPageState extends State { ), SizedBox(height: 16), - Container( - width: double.infinity, - height: 56, - child: ElevatedButton.icon( - onPressed: () => Navigator.of(context).push( - MaterialPageRoute(builder: (context) => SupportScreen()), - ), - icon: Icon(Icons.help_outline, size: 20), - label: Text('Support'), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFF6A4C93), - foregroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - padding: EdgeInsets.symmetric(horizontal: 16), - ), - ), - ), - - SizedBox(height: 16), - Container( width: double.infinity, height: 56, @@ -779,12 +815,10 @@ class _SettingsPageState extends State { height: 56, child: ElevatedButton.icon( onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => NotificationsSettingsScreen(), - ), + MaterialPageRoute(builder: (context) => SupportScreen()), ), - icon: Icon(Icons.notifications_outlined, size: 20), - label: Text('Notifications'), + icon: Icon(Icons.help_outline, size: 20), + label: Text('Support'), style: ElevatedButton.styleFrom( backgroundColor: Color(0xFF6A4C93), foregroundColor: Colors.white, @@ -798,30 +832,6 @@ class _SettingsPageState extends State { SizedBox(height: 32), - Container( - width: double.infinity, - height: 56, - child: ElevatedButton.icon( - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => EditProfileScreen(userData: userData), - ), - ), - icon: Icon(Icons.edit, size: 20), - label: Text('Update your Profile'), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFF6A4C93), - foregroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - padding: EdgeInsets.symmetric(horizontal: 16), - ), - ), - ), - - SizedBox(height: 16), - Container( width: double.infinity, height: 56,