颤振单子滚动视图部分不滚动



我有一个简单的脚手架,其中有3个容器,我希望第一个容器保持固定,并且只对第二个容器及其他容器进行滚动。但由于某种原因,使用下面的代码,我根本无法滚动,并且出现overflow by xxx pixels on the bottom错误。

Scaffold(
body: Container(
margin: EdgeInsets.only(
top: MediaQuery.of(context).padding.top,
),
child: Column(
children: [
Container(
height: 300,
width: 400,
color: Colors.black,
),
SingleChildScrollView(
child: Column(
children: [
Container(
width: ScreenUtil().setWidth(578),
height: ScreenUtil().setWidth(578),
color: Colors.red,
margin: EdgeInsets.all(30),
),
Container(
width: ScreenUtil().setWidth(578),
height: ScreenUtil().setWidth(578),
color: Colors.red,
),
],
),
),
],
),
),
);

SingleChildScrollView包装第一列很好(在代码下面(,但这允许滚动整个页面,这不是我想要的。我错过了什么?

Scaffold(
body: Container(
margin: EdgeInsets.only(
top: MediaQuery.of(context).padding.top,
),
child: SingleChildScrollView(
child: Column(
children: [
Container(
height: 300,
width: 400,
color: Colors.black,
),
Container(
width: ScreenUtil().setWidth(578),
height: ScreenUtil().setWidth(578),
color: Colors.red,
margin: EdgeInsets.all(30),
),
Container(
width: ScreenUtil().setWidth(578),
height: ScreenUtil().setWidth(578),
color: Colors.red,
),
],
),
),
),
);

在容器中包装SingleChildScrollView并设置其大小