From fa626992dc4d1751418d6173db6e493a60fa5e54 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 10:17:12 +0300 Subject: [PATCH] feat: delete back button from main home screens --- frontend/lib/screens/pages/feed_page.dart | 1 + .../lib/screens/pages/invitations_page.dart | 5 ++- frontend/lib/screens/pages/profile_page.dart | 41 ++++++++++--------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/frontend/lib/screens/pages/feed_page.dart b/frontend/lib/screens/pages/feed_page.dart index a380c4b..855bd7b 100644 --- a/frontend/lib/screens/pages/feed_page.dart +++ b/frontend/lib/screens/pages/feed_page.dart @@ -76,6 +76,7 @@ class _FeedPageState extends State { preferredSize: Size.fromHeight(1), child: Container(height: 1, color: Colors.grey[200]), ), + automaticallyImplyLeading: false, ), body: RefreshIndicator( onRefresh: () async { diff --git a/frontend/lib/screens/pages/invitations_page.dart b/frontend/lib/screens/pages/invitations_page.dart index 80d8680..a4e6367 100644 --- a/frontend/lib/screens/pages/invitations_page.dart +++ b/frontend/lib/screens/pages/invitations_page.dart @@ -79,6 +79,7 @@ class _InvitationsPageState extends State { preferredSize: Size.fromHeight(1), child: Container(height: 1, color: Colors.grey[200]), ), + automaticallyImplyLeading: false, ), body: Padding( padding: EdgeInsets.all(16), @@ -256,7 +257,9 @@ class _InvitationsPageState extends State { floatingActionButton: FloatingActionButton( onPressed: () { ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Create invitation functionality coming soon!')), + SnackBar( + content: Text('Create invitation functionality coming soon!'), + ), ); }, backgroundColor: Color(0xFF6A4C93), diff --git a/frontend/lib/screens/pages/profile_page.dart b/frontend/lib/screens/pages/profile_page.dart index b08beaf..d0a42ab 100644 --- a/frontend/lib/screens/pages/profile_page.dart +++ b/frontend/lib/screens/pages/profile_page.dart @@ -86,7 +86,7 @@ class _ProfilePageState extends State { }); final result = await UserService.getCurrentUser(); - + setState(() { isLoadingUser = false; if (result['success'] == true) { @@ -107,10 +107,7 @@ class _ProfilePageState extends State { actions: [ TextButton( onPressed: () => Navigator.of(context).pop(), - child: Text( - 'OK', - style: TextStyle(color: Color(0xFF6A4C93)), - ), + child: Text('OK', style: TextStyle(color: Color(0xFF6A4C93))), ), ], ), @@ -163,14 +160,18 @@ class _ProfilePageState extends State { children: [ if (isLoadingUser) CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Color(0xFF6A4C93)), + valueColor: AlwaysStoppedAnimation( + Color(0xFF6A4C93), + ), ) else if (userData != null) ...[ CircleAvatar( radius: 50, backgroundColor: Color(0xFF6A4C93), child: Text( - (userData!['displayName'] ?? 'U').substring(0, 1).toUpperCase(), + (userData!['displayName'] ?? 'U') + .substring(0, 1) + .toUpperCase(), style: TextStyle( color: Colors.white, fontSize: 36, @@ -201,10 +202,7 @@ class _ProfilePageState extends State { SizedBox(height: 16), Text( 'Failed to load user data', - style: TextStyle( - fontSize: 18, - color: Colors.grey[600], - ), + style: TextStyle(fontSize: 18, color: Colors.grey[600]), ), SizedBox(height: 8), ElevatedButton( @@ -302,7 +300,9 @@ class _ProfilePageState extends State { radius: 16, backgroundColor: Color(0xFF6A4C93), child: Text( - (userData!['displayName'] ?? 'U').substring(0, 1).toUpperCase(), + (userData!['displayName'] ?? 'U') + .substring(0, 1) + .toUpperCase(), style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, @@ -316,7 +316,8 @@ class _ProfilePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - userData!['displayName'] ?? 'Unknown User', + userData!['displayName'] ?? + 'Unknown User', style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, @@ -465,13 +466,12 @@ class _SettingsPageState extends State { TextButton( onPressed: () async { Navigator.of(context).pop(); - + await AuthService.logout(); - - Navigator.of(context).pushNamedAndRemoveUntil( - '/', - (route) => false, - ); + + Navigator.of( + context, + ).pushNamedAndRemoveUntil('/', (route) => false); }, child: Text('Sign Out', style: TextStyle(color: Colors.red)), ), @@ -493,6 +493,7 @@ class _SettingsPageState extends State { preferredSize: Size.fromHeight(1), child: Container(height: 1, color: Colors.grey[200]), ), + automaticallyImplyLeading: false, ), body: Padding( padding: EdgeInsets.all(16), @@ -603,4 +604,4 @@ class _SettingsPageState extends State { ), ); } -} \ No newline at end of file +}