我正在尝试使用 SingleChildScrollView 使堆栈布局可滚动,但它不滚动。这里应该使用 SingleChildScrollView 吗?
我想我已经给出了足够的描述,让任何人都能理解我的问题。此处提供更多文本以满足 StackOverflow 提出问题的要求。为此事道歉。
这是示例代码。
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
child: Center(
child: LayoutBuilder(
builder:
(BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: viewportConstraints.maxHeight,
),
child: IntrinsicHeight(
child: Column(
children: <Widget>[
Container(
// A fixed-height child.
color: Colors.white,
height: 120.0,
),
Expanded(
// A flexible child that will grow to fit the viewport but
// still be at least as big as necessary to fit its …Run Code Online (Sandbox Code Playgroud)