【发布时间】:2021-06-16 15:31:15
【问题描述】:
如何在不滚动的情况下在末端抽屉中添加多个(13 项)而不滚动
【问题讨论】:
标签: flutter flutter-layout flutter-dependencies flutter-animation
如何在不滚动的情况下在末端抽屉中添加多个(13 项)而不滚动
【问题讨论】:
标签: flutter flutter-layout flutter-dependencies flutter-animation
使用Expanded 小部件作为这些项目的父级并放置在Column 下。
你的抽屉应该是这样的:
Drawer(
child: Column(
children: [
Container(), //Your Blue Section
Expanded( // Item 1
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.00),
Row(
children: [
Icon(),
Text(),
],
),
),
),
Expanded( // Item 1
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.00),
Row(
children: [
Icon(),
Text(),
],
),
),
),
Expanded( // Item 2
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.00),
Row(
children: [
Icon(),
Text(),
],
),
),
),
Expanded( // Item 3
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.00),
Row(
children: [
Icon(),
Text(),
],
),
),
),
Expanded( // Item 4
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.00),
Row(
children: [
Icon(),
Text(),
],
),
),
),
.
. and so on ...
.
]
)
),
【讨论】:
将包含项目的列放在溢出小部件中
OverflowBox(
child : Column(
children: [
/// items
]
)
)
【讨论】: