feat: add a puzzle new page

This commit is contained in:
sBubshait 2025-08-03 12:52:59 +03:00
parent 8d730c7c15
commit 2b64d4ad50

View File

@ -14,7 +14,12 @@ class _HomeScreenState extends State<HomeScreen> {
int _currentIndex = 0; int _currentIndex = 0;
int _availableInvitationsCount = 0; int _availableInvitationsCount = 0;
final List<Widget> _pages = [FeedPage(), InvitationsPage(), WordlePage(), ProfilePage()]; final List<Widget> _pages = [
FeedPage(),
InvitationsPage(),
WordlePage(),
ProfilePage(),
];
@override @override
void initState() { void initState() {
@ -44,7 +49,7 @@ class _HomeScreenState extends State<HomeScreen> {
if (_availableInvitationsCount == 0) { if (_availableInvitationsCount == 0) {
return Icon(Icons.mail); return Icon(Icons.mail);
} }
return Stack( return Stack(
children: [ children: [
Icon(Icons.mail), Icon(Icons.mail),
@ -57,12 +62,11 @@ class _HomeScreenState extends State<HomeScreen> {
color: Colors.red, color: Colors.red,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
constraints: BoxConstraints( constraints: BoxConstraints(minWidth: 16, minHeight: 16),
minWidth: 16,
minHeight: 16,
),
child: Text( child: Text(
_availableInvitationsCount > 99 ? '99+' : '$_availableInvitationsCount', _availableInvitationsCount > 99
? '99+'
: '$_availableInvitationsCount',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
@ -109,13 +113,22 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
items: [ items: [
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Feed'), BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Feed',
),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: _buildInvitationsBadge(), icon: _buildInvitationsBadge(),
label: 'Invitations', label: 'Invitations',
), ),
BottomNavigationBarItem(icon: Icon(Icons.games), label: 'Puzzles'), BottomNavigationBarItem(
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Profile'), icon: Icon(Icons.games),
label: 'Puzzles',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
),
], ],
), ),
), ),