【发布时间】:2019-06-13 22:00:10
【问题描述】:
如何在 Flutter 中以编程方式关闭 Persistent BottomSheet?还有有没有办法只显示部分持久性底部工作表,用户可以向上拖动工作表以查看完整内容?
下面的代码是为了显示持久的底页。
homeScaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) {
return Container(
height: 300.0,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'Persistent header for bottom bar!',
textAlign: TextAlign.left,
)),
Text(
'Then here there will likely be some other content '
'which will be displayed within the bottom bar',
textAlign: TextAlign.left,
),
],
));
});
【问题讨论】: