feat(app): Added a popup menu to bottom navbar

This commit is contained in:
2024-04-18 14:49:45 +03:00
parent ca74cc80a1
commit e602e5d239
12 changed files with 171 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
import 'package:eatvio_app/core/app_export.dart';
import 'package:flutter/material.dart';
import 'package:eatvio_app/widgets/app_bar/appbar_title_circleimage.dart';
import 'package:eatvio_app/widgets/custom_navigation_menu.dart';
// ignore: must_be_immutable
class CustomBottomBar extends StatefulWidget {
@@ -86,7 +87,6 @@ class CustomBottomBarState extends State<CustomBottomBar> {
Navigator.pushNamed(context, AppRoutes.myProfile);
break;
case 1:
//Navigator.pushNamed(context, AppRoutes.myProfile);
break;
case 2:
Navigator.pushNamed(context, AppRoutes.diaryEdit);
@@ -94,13 +94,6 @@ class CustomBottomBarState extends State<CustomBottomBar> {
case 3:
Navigator.pushNamed(context, '/chat');
break;
case 4:
//Navigator.pushNamed(context, '/chat');
break;
case 5:
Navigator.pushNamed(context, AppRoutes.mySettings);
break;
default:
}
}
@@ -111,7 +104,7 @@ class CustomBottomBarState extends State<CustomBottomBar> {
double iconWidth;
if (index == 0) {
// Для логотипа
// Для логотипа-
iconHeight = 52.v; // Увеличиваем высоту
iconWidth = 48.h; // Меняем ширину, чтобы сохранить пропорции
} else if (index == bottomMenuList.length - 2) {
@@ -141,7 +134,31 @@ class CustomBottomBarState extends State<CustomBottomBar> {
isSelected ? theme.colorScheme.primary : appTheme.blueGray400,
),
if (bottomMenuList[index].image)
AppbarTitleCircleimage(imagePath: ImageConstant.imgEllipse1),
GestureDetector(
onTap: () => showMenu(
context: context,
color: Colors.white,
shadowColor: Colors.white,
surfaceTintColor: Colors.white,
position: RelativeRect.fromLTRB(
// Указываем позицию справа по центру
MediaQuery.of(context).size.width -
50, // Расположение от правого края
kToolbarHeight + 340, // Расположение от верхнего края
0, // Не смещаем по горизонтали
0, // Не смещаем по вертикали
),
items: [
PopupMenuItem(
child:
CustomNavigationMenu(), // Используйте ваше меню здесь
)
],
),
child: AppbarTitleCircleimage(
imagePath: ImageConstant.imgEllipse1,
),
),
if (bottomMenuList[index].title !=
null) // Проверяем, существует ли title
Padding(