我试图让一个容器固定下来,屏幕的另一部分可以做一些滚动操作,有没有可能不复制屏幕,只复制这两个事件?

return SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(
child: Column(
children: <Widget>[
Container(
height: 200,
width: double.infinity,
color: Colors.red,
),
SingleChildScrollView(
child: Container(color: Colors.blue,height: 1000,width: double.infinity,))
/* body(context, screenWidth, screenHeight),
bottmtop(context), */
],
),
),
);发布于 2020-06-09 12:25:59
您可以使用此示例作为它。如果您想要用户列表,请使用SliverList代替SliverFillRemaining;
class HeadState extends State<Head> {
@override
Widget build(BuildContext context) {
var screenHeight = MediaQuery.of(context).size.height;
var screenWidth = MediaQuery.of(context).size.width;
return Scaffold(
bottomNavigationBar: BottomNavigationBar(items: []),
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
expandedHeight: screenHeight / 4,
flexibleSpace: Container(
color: Colors.red,
),
),
SliverFillRemaining(
child: Container(
height: screenHeight - screenHeight / 4,
color: Colors.blue,
),
)
],
),
);
}
}https://stackoverflow.com/questions/62274786
复制相似问题