From 2b64d4ad5075e1818616c890f95f42aff401fdaa Mon Sep 17 00:00:00 2001 From: sBubshait Date: Sun, 3 Aug 2025 12:52:59 +0300 Subject: [PATCH] feat: add a puzzle new page --- frontend/lib/screens/home_screen.dart | 33 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/frontend/lib/screens/home_screen.dart b/frontend/lib/screens/home_screen.dart index fbfc7a3..a856e0c 100644 --- a/frontend/lib/screens/home_screen.dart +++ b/frontend/lib/screens/home_screen.dart @@ -14,7 +14,12 @@ class _HomeScreenState extends State { int _currentIndex = 0; int _availableInvitationsCount = 0; - final List _pages = [FeedPage(), InvitationsPage(), WordlePage(), ProfilePage()]; + final List _pages = [ + FeedPage(), + InvitationsPage(), + WordlePage(), + ProfilePage(), + ]; @override void initState() { @@ -44,7 +49,7 @@ class _HomeScreenState extends State { if (_availableInvitationsCount == 0) { return Icon(Icons.mail); } - + return Stack( children: [ Icon(Icons.mail), @@ -57,12 +62,11 @@ class _HomeScreenState extends State { color: Colors.red, borderRadius: BorderRadius.circular(10), ), - constraints: BoxConstraints( - minWidth: 16, - minHeight: 16, - ), + constraints: BoxConstraints(minWidth: 16, minHeight: 16), child: Text( - _availableInvitationsCount > 99 ? '99+' : '$_availableInvitationsCount', + _availableInvitationsCount > 99 + ? '99+' + : '$_availableInvitationsCount', style: TextStyle( color: Colors.white, fontSize: 10, @@ -109,13 +113,22 @@ class _HomeScreenState extends State { backgroundColor: Colors.transparent, elevation: 0, items: [ - BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Feed'), + BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Feed', + ), BottomNavigationBarItem( icon: _buildInvitationsBadge(), label: 'Invitations', ), - BottomNavigationBarItem(icon: Icon(Icons.games), label: 'Puzzles'), - BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Profile'), + BottomNavigationBarItem( + icon: Icon(Icons.games), + label: 'Puzzles', + ), + BottomNavigationBarItem( + icon: Icon(Icons.person), + label: 'Profile', + ), ], ), ),