如何在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
android - 如何在 Flutter 中动态附加到 Column 小部件的子级
firebase - 使用 FirebaseAuth 、 Firestore 和 Google 登录
email - 使用 Flutter 的电子邮件进行 Firebase 身份验证