class HasMinHeightScrollView extends StatelessWidget {
const HasMinHeightScrollView({super.key});
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: viewportConstraints.maxHeight,
),
child: IntrinsicHeight(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Container(
color: Colors.red,
child: Text('첫 번째 위젯'),
height: 150.0,
),
Expanded(
child: Container(
color: Colors.blue,
child: SizedBox(),
),
),
],
),
),
),
);
},
);
}
}