首页 > 解决方案 > flutter bottomsheet with notch(类似于bottomNavigationBar:BottomAppBar的shape属性)

问题描述

问题1:如何在floatingactionbutton周围添加一个凹口来颤动底部工作表,使其看起来像一个bottomappbar(具有CircularNotchedRectangle()的形状)但表现得像bottomsheet(可以拖动以关闭)

问题 2:如何使底页不可关闭但仍可拖动。(类似于android的底页)

问题 3:bottomsheet 窥视高度,bottomsheet 可忽略,但也可扩展(再次,就像 android bottomsheet)

是否有可能实现我上面列出的内容?还是我运气不好,必须使用第 3 方库?(如果有的话?)

在此处输入图像描述

标签: dartflutterbottomnavigationview

解决方案


你也可以使用这种技术

Scaffold(
  backgroundColor: myBackgroundColor,
    floatingActionButtonLocation: FloatingActionButtonLocation.startDocked, //specify the location of the FAB
    floatingActionButton: CircleAvatar(
      radius: 32,
      backgroundColor: myBackgroundColor,
      child: Padding(
        padding: EdgeInsets.all(1),
        child: FloatingActionButton(
          backgroundColor: MyColor.textColor,
          onPressed: () {
            print('OK');
          },
          child: Container(
            margin: EdgeInsets.all(15.0),
            child: Icon(Icons.add),
          ),
          elevation: 4.0,
        ),
      ),
    ),
    bottomNavigationBar: BottomAppBar(
      child: Container(
        color: MyColor.textColor,
        height: 35,
      ),
    )
);

推荐阅读