可展开底部应用栏

具有可扩展工作表的动画底部应用栏。

ExpandableBottomAppBar

入门

添加插件

dependencies:
  ...
  expandable_bottom_bar: any

基本用法

添加小部件

bottomNavigationBar: BottomExpandableAppBar(
        // Provide the bar controller in build method or default controller as ancestor in a tree 
        controller: bbc,
        expandedHeight: expandedHeight.value,
        horizontalMargin: 16,
        expandedBackColor: Theme.of(context).backgroundColor,
        // Your bottom sheet code here
        expandedBody: Center(
          child: Text("Hello world!"),
        ),
        // Your bottom app bar code here
        bottomAppBarBody: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
              Expanded(
                child: Text(
                  "Hello",
                  textAlign: TextAlign.center,
                ),
              ),
              Spacer(
                flex: 2,
              ),
              Expanded(
                child: Text(
                  "World",
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),
      )

自定义(可选)

底部可展开应用栏

horizontalMargin - 纸张的侧边距

bottomOffset - 折叠状态下,顶部纸张边缘到顶部应用栏边缘的距离

shape - FAB的切口形状

appBarHeight - 如果需要改变应用栏高度

bottomAppBarColor - 应用栏容器的背景色

或者
appBarDecoration - 应用栏容器的装饰

expandedBackColor - 纸张容器的背景色

或者
expandedDecoration - 纸张容器的装饰

控件

BottomAppBarController

settings

snap - 如果为true,纸张将自动吸附到展开或折叠状态

dragLength - 指针需要移动多远才能完全展开/折叠纸张

回调

需要定义dragLength

onDrag - 与GestureDetector一起使用以进行滑动控制

onDragEnd - 与GestureDetector一起使用以进行滑动控制

open - 将纸张切换到折叠状态

close - 将纸张切换到展开状态

swap - 如果纸张已展开,则折叠它,反之亦然

GitHub

https://github.com/rIIh/expandable-bottom-bar