flutter - Flutter How to remove white blank between sliverappbar and sliverList when pull down sliverlist?
问题描述
I'd like to do sync pull down for SliverAppBar together with SliverList but when pull down the SliverList, there comes a white blank between these 2 widgets.
Does anyone knows how to remove the padding between them? Thanks a lot.
What I mean is how to set SliverAppBar and SliverList always stick to each other.
Scaffold(
body: CustomScrollView(controller: controller, slivers: [
SliverAppBar(
// pinned: true,
// floating: true,
flexibleSpace: FlexibleSpaceBar(
background: HomeTopBar(
picHeightExtra: picHeightExtra,
fitMode: fitMode,
)),
expandedHeight: 500 + picHeightExtra,
),
SliverList(
delegate: SliverChildBuilderDelegate((context, index) {
return Container(
height: 50,
color: Colors.blueAccent,
);
}, childCount: 30, addRepaintBoundaries: false),
),
]));
解决方案
终于找到答案了……
需要将 CustomScrollView 的物理特性更改为 ClampingScrollPhysics 并且“顶部”小部件不会有空白。
推荐阅读
- terraform - Move/combine state between Terraform modules?
- jquery - Problem with AOS.js not working when Slick.js is on the same page
- python - how to assign returned values into a variable using for loop
- c++ - Repeating a question when answer is wrong
- python - 为什么 check_password_hash 函数返回 false?使用 Flask、SQLite3 和 Werkzeug
- xml - Unable to load XML validator libraries. XML validation will not be performed
- java - Why does the timezone specified in the JDBC connection string effect how Instants are stored in MySQL?
- python - Cannot install tensorflow with error EnvironmentError: [Errno 2] No such file or directory
- python - open a gzip file when read by argparse
- c# - Google Primary Calendar for user contains no ConferenceProperties or no AllowedConferenceSolutionTypes