小编sae*_* gh的帖子

使用颤动触摸制作可调整大小的下拉小部件

我想创建一个如下图所示的下拉菜单,通过触摸和拖动和触摸外部来打开它。

拖动前

拖动后

Scaffold(
  appBar: AppBar(
    automaticallyImplyLeading: false
  ),
  body: Stack(
    children: <Widget>[
      Container(
        height: 200,
        decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.vertical(bottom: Radius.circular(20))
        ),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            Align(
              alignment: Alignment.bottomCenter,
              child: Column(
                children: <Widget>[
                  Padding(
                    padding: EdgeInsets.symmetric(horizontal: 40),
                    child: Divider(
                      color: Colors.blueGrey[500],
                      height: 10,
                      indent: 5,
                    ),
                  ),
                  Icon(FontAwesomeIcons.angleDoubleDown,size: 15,color: Colors.blueGrey[500],)
                ],
              ),
            )
          ],
        ),
      ),
      Center(child: Text('List View'),)
    ],
  )
)
Run Code Online (Sandbox Code Playgroud)

我想更改高度,但遇到溢出错误!制作此小部件的最佳方法是什么?我可以在 AppBar 中执行此操作吗?

dropdownbox flutter flutter-animation

4
推荐指数
1
解决办法
1915
查看次数

标签 统计

dropdownbox ×1

flutter ×1

flutter-animation ×1