就像标题所说的那样,有没有办法将小部件放在屏幕底部展开
Expanded -> SingleChildScrollView() -> column(children: [ -> Container() -> ElevatedButton() ])
我希望将 ElevatedButton 放置在屏幕底部,我也不想将其放置在 Expanded 小部件之外,有没有办法做到这一点?
SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height - APPBAR_SIZE,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(child: CHILD),
ElevatedButton(),
],
),
),
)
更新:
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: MediaQuery.of(context).size.height - APPBAR_SIZE - ElevatedButtonHeight,
child: SingleChildScrollView(
child: Container(child: CHILD),
),
),
ElevatedButton(),
],
),
Expanded(
child: Column(
children: [
Container(),
//use Spacer(),
Spacer(),
ElevatedButton()
],
),
)
尝试在列内使用垫片