简体   繁体   English

底部导航栏中的可扩展浮动操作按钮 - Flutter

[英]Expandable Floating Action button in bottom navigation bar - Flutter

I am trying to implement the below design我正在尝试实现以下设计

在此处输入图像描述

When I add the expandable floating button to the notch in bottom navigation bar it break the design of bottom navigation bar.当我将可扩展的浮动按钮添加到底部导航栏的凹槽时,它破坏了底部导航栏的设计。

在此处输入图像描述

I tried AnchorOverlay but didn't help.我尝试了 AnchorOverlay 但没有帮助。 Below is the code of my main screen where the expandable widget is notched in the bottom app bar下面是我的主屏幕的代码,其中可扩展小部件位于底部应用栏中

@override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: kPrimaryColor,
      floatingActionButton: ExpandableFab(
        distance: 112.0,
        children: [
          ActionButton(
            onPressed: () {},
            icon: const Icon(Icons.format_size),
          ),
          ActionButton(
            onPressed: () {},
            icon: const Icon(Icons.insert_photo),
          ),
          ActionButton(
            onPressed: () {},
            icon: const Icon(Icons.videocam),
          ),
        ],
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: BottomAppBar(
        //bottom navigation bar on scaffold
        color: Colors.redAccent,
        shape: const CircularNotchedRectangle(), //shape of notch
        notchMargin:
            5, //notche margin between floating button and bottom appbar
        child: Row(
          //children inside bottom appbar
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            IconButton(
              icon: const Icon(
                Icons.menu,
                color: Colors.white,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.search,
                color: Colors.white,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.print,
                color: Colors.white,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.people,
                color: Colors.white,
              ),
              onPressed: () {},
            ),
          ],
        ),
      ),
    );
  }

请参考此https://codewithandrea.com/articles/adding-animated-overlays-to-your-app/也许您的问题将得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有浮动操作按钮的底部导航栏 flutter - bottom navigation bar with Floating Action Button flutter 导航栏中的居中浮动操作按钮 Flutter - Centering Floating Action Button in navigation bar Flutter Flutter 中的浮动底部导航栏和浮动操作按钮 - Floating Bottom Nav Bar and Floating Action Button in Flutter 如何使用浮动操作按钮自定义底部导航栏以及左右曲线设计? - How to customize a bottom navigation bar in flutter with floating action button and and also curve design to the left and right? 如何在带边框的中心底部导航栏中添加浮动操作按钮? - How to add Floating action Button in Bottom Navigation Bar in Center with border? 如何在带有缺口的底部导航栏中心添加浮动操作按钮? - How to add Floating action Button in Bottom Navigation Bar Center with notch? Flutter中如何实现可扩展的底部导航栏 - How to achieve an expandable bottom navigation bar in Flutter 如何在 Flutter 中使用浮动底部导航栏 - How to use floating bottom navigation bar in Flutter 在可扩展浮动操作按钮中,在颤动中未检测到子小部件中的手势 - In Expandable Floating action button the gestures in the child widget is not detected in flutter 可扩展的浮动操作按钮(使用堆栈)在 flutter 中不起作用 - Expandable floating action button (using Stack) not working in flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM