dart - CustomScrollView 中的 Flutter 固定按钮

如何在CustomScrollView的底部制作一个按钮固定“粘滞”

如何实现如截图 /image/RDCn9.png

最佳答案

一种方法——使用——BottomNavigationBar

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>\[
          SliverAppBar(
            title: Text('Sliver App Bar'),
            expandedHeight: 125.0,
          ),
          SliverList(
              delegate: SliverChildBuilderDelegate((context, int) {
            return Text('Boo');
          }, childCount: 65)),
          SliverFillRemaining(
            child: Text('Foo Text'),
          ),
        \],
      ),
      bottomNavigationBar: Padding(
        padding: EdgeInsets.all(8.0),
        child: RaisedButton(
          onPressed: () {},
          color: Colors.blue,
          textColor: Colors.white,
          child: Text('Fixed Button'),
        ),
      ),
    );
  }][1]][1]

输出:

https://stackoverflow.com/questions/54114221/

相关文章:

dart - 如何使用 Flutter 在 Android 中显示 iOS/cupertino 警报

dart - const 在 Flutter 中定义 EdgeInsets 中的作用

flutter - 如何在 Flutter 中实现交错 GridView ?

dart - 有没有办法在 Flutter 的多个 PageRoutes 中使用 Inherited

dart - 如何在 flutter 中调整芯片的大小

android - 如何在 Flutter 中动态附加到 Column 小部件的子级

firebase - 使用 FirebaseAuth 、 Firestore 和 Google 登录

email - 使用 Flutter 的电子邮件进行 Firebase 身份验证

dart - NumberFormat 未找到 flutter

dart - Flutter - 显示来自相机的本地镜像