我有扩展面板列表的代码,它工作正常,但我无法扩展扩展面板的大小。另外,我希望扩展面板有一个边框半径,但我不确定是否可以给出边框半径
return Column(children: [
Stack(
clipBehavior: Clip.none,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50),
child: ExpansionPanelList(
animationDuration: Duration(milliseconds: 1000),
children: [
ExpansionPanel(
headerBuilder: (context, isExpanded) {
return Column(
children: [
Text("Salmon Poké"),
Text("Rs. 2000"),
],
);
},
body: Text(
'This salmon sashimi is a delicious light appetizer served with fresh wasabi, ginger, soy sauce or a delicious side of soy yuzo citrus ponzu.',
style: TextStyle(
fontSize: 18,
color: Colors.black,
),
),
isExpanded: _expanded,
canTapOnHeader: true,
backgroundColor: Colors.white),
],
dividerColor: Colors.grey,
expansionCallback: (panelIndex, isExpanded) {
_expanded = !_expanded;
setState(() {});
},
),
),
Positioned(
top: -55,
right: 240,
child: CircleAvatar(
radius: 105,
child: ClipOval(
child: Image(
image: AssetImage('assets/images/salmon.png'),
),
),
backgroundColor: Colors.transparent,
),
),
],
),
]);
} }
**这是给定代码的 UI **
这是我想要的输出。 (此 UI 是使用容器小部件制作的,但我希望此布局使用扩展面板列表)
This is the output that I want
我非常感谢您的帮助。
最佳答案
将 ExpansionPanelList 包装在 ClipRRect 中。
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: ExpansionPanelList(
children: [ExpansionPanel(body: Text('Hello World'))])
)
关于android - Flutter-可以将边框半径赋予扩展面板列表吗?如果是,应该使用哪些属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68716265/