如何在不滚动的情况下在末端抽屉中添加多个 ListTile?
How to add multiple ListTile in end drawer without scrolling in flutter?
如何在不滚动的情况下在末端抽屉中添加多个(13 个项目)
将包含项目的列放在溢出小部件中
OverflowBox(
child : Column(
children: [
/// items
]
)
)
使用 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 ...
.
]
)
),
如何在不滚动的情况下在末端抽屉中添加多个(13 个项目)
将包含项目的列放在溢出小部件中
OverflowBox(
child : Column(
children: [
/// items
]
)
)
使用 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 ...
.
]
)
),