From bd88d8003481ee66f87df42423bc6c72b0e3722c Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 5 Jun 2024 13:13:35 +0300 Subject: [PATCH] fix style warning --- lib/widgets/bottom_navigation_bar_widget.dart | 80 ++++++++++--------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/lib/widgets/bottom_navigation_bar_widget.dart b/lib/widgets/bottom_navigation_bar_widget.dart index dbf9ba2b..6f29ef34 100644 --- a/lib/widgets/bottom_navigation_bar_widget.dart +++ b/lib/widgets/bottom_navigation_bar_widget.dart @@ -19,51 +19,53 @@ class BottomNavigationBarWidget extends StatefulWidget { } class _BottomNavigationBarWidgetState extends State { + void _onItemTapped(int index) { + if (currentBottomNavBarIndex != index) { + setState(() { + currentBottomNavBarIndex = index; + }); + } + switch (currentBottomNavBarIndex) { + case 0: + GoRouter.of(context).replace('/my-profile-screen'); + break; + case 1: + GoRouter.of(context).replace('/feed-screen'); + break; + case 2: + GoRouter.of(context).replace('/diary-screen'); + break; + case 3: + GoRouter.of(context).replace('/chat-select-screen'); + break; + case 4: + break; + case 5: + final RenderBox overlay = Overlay.of(context).context.findRenderObject() as RenderBox; + final size = overlay.size; + showMenu( + context: context, + color: Colors.white, + shadowColor: Colors.white, + surfaceTintColor: Colors.white, + items: [ + PopupMenuItem( + child: CustomNavigationMenu(), + ) + ], + position: RelativeRect.fromLTRB(size.width, size.height, 0, 0), + ); + break; + } + } + @override Widget build(BuildContext context) { return Scaffold( body: widget.child, bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, - onTap: (index) { - if (currentBottomNavBarIndex != index) { - setState(() { - currentBottomNavBarIndex = index; - }); - } - switch (currentBottomNavBarIndex) { - case 0: - GoRouter.of(context).replace('/my-profile-screen'); - break; - case 1: - GoRouter.of(context).replace('/feed-screen'); - break; - case 2: - GoRouter.of(context).replace('/diary-screen'); - break; - case 3: - GoRouter.of(context).replace('/chat-select-screen'); - break; - case 4: - break; - case 5: - final RenderBox overlay = Overlay.of(context).context.findRenderObject() as RenderBox; - final size = overlay.size; - showMenu( - context: context, - color: Colors.white, - shadowColor: Colors.white, - surfaceTintColor: Colors.white, - items: [ - PopupMenuItem( - child: CustomNavigationMenu(), - ) - ], - position: RelativeRect.fromLTRB(size.width, size.height, 0, 0), - ); - break; - } - }, + onTap: _onItemTapped, selectedFontSize: 12, unselectedFontSize: 12, selectedItemColor: appTheme.blueA400,