首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带缺口的颤动底板(类似于bottomNavigationBar: BottomAppBar的shape属性)

带缺口的颤动底板(类似于bottomNavigationBar: BottomAppBar的shape属性)
EN

Stack Overflow用户
提问于 2018-09-10 19:49:15
回答 2查看 2.2K关注 0票数 0

问题1:如何在浮动操作按钮周围添加一个凹口,使其看起来像一个底部应用程序条(形状为CircularNotchedRectangle()),但行为却像底部工作表(可以拖动以取消)

问题2:如何使底页不可忽略,但仍可拖动。(类似于android的底单)

问题3:底单窥视高度,底单可以忽略,但也可以扩展(同样,就像android的底单一样)

有没有可能实现我上面列出的内容?或者我不走运,不得不使用第三方库?(如果有的话?)

EN

回答 2

Stack Overflow用户

发布于 2020-10-06 22:50:54

希望对您有所帮助:)

代码语言:javascript
复制
Scaffold(
    floatingActionButtonLocation: FloatingActionButtonLocation.startDocked, //specify the location of the FAB
    floatingActionButton: FloatingActionButton(
      backgroundColor: Colors.blue,
      onPressed: () {
        print('OK');
      },
      tooltip: "start FAB",
      child: Container(
        margin: EdgeInsets.all(15.0),
        child: Icon(Icons.add),

      ),
      elevation: 4.0,
    ),
    bottomNavigationBar: BottomAppBar(
      child: Container(
        color: mycolor,
        height: 35,
      ),
    )
);
票数 0
EN

Stack Overflow用户

发布于 2020-10-06 23:09:57

您也可以使用此技术

代码语言:javascript
复制
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,
      ),
    )
);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52257152

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档