美文网首页
Flutter widget始终保持在屏幕底部

Flutter widget始终保持在屏幕底部

作者: 赵哥窟 | 来源:发表于2021-06-07 10:10 被阅读0次
截屏2021-06-07 10.05.35.png

这样的布局,确认支付要在屏幕的最底部,只需要Stack+Positioned 这种方式也可以实现。

Widget _bodyWidget(ConfirmPaymentState state, Dispatch dispatch, ViewService viewService) {
  return Scaffold(
    backgroundColor: Global.pageBackgroundColor,
    appBar: AppBar(
      elevation: 0, //去掉Appbar底部阴影
      title: Text("确认支付"),
      backgroundColor:Global.pageBackgroundColor,
      centerTitle: true,
    ),
    body: Stack(
      children: [
        ListView(
          children: [
                //头部代码省略
          ],
        ),
        Positioned(
          left: 0,
          right: 0,
          bottom:0,
          child: _bottomWidget(),
        ),

      ],
    ),
  );
}

相关文章

网友评论

      本文标题:Flutter widget始终保持在屏幕底部

      本文链接:https://www.haomeiwen.com/subject/wnxleltx.html