问题描述
我正在尝试设置 Flutter 中 ExpansionPanel
内的 ExpansionPanelList
样式,但背景图像不适用于面板的整个标题区域。
我想在 expandPanel 的 headerbuilder
上应用背景图片。
Currenlty 我正在尝试借助堆栈并为其提供背景图像。这样做,图像覆盖了大部分标题构建器区域,但未覆盖 expansionPanel
箭头下方的区域。
我希望背景图片也覆盖扩展面板箭头下方的区域。我该怎么做?
ExpansionPanelList(
expansionCallback: (index,isExpanded) { // Some code },children: _items.map((MyItem _item) {
return ExpansionPanel(
canTapOnHeader: true,backgroundColor: Colors.yellow,// Want to add the picture in the background of
// header builder
headerBuilder: (context,isExpanded) {
return Stack(
children: [
// >>>>>>>>>>>>>> Image
Container(
child: Image.network(
_item.prodCtgData
.pic,width: double.infinity,fit: BoxFit.fitWidth,),// >>>>>>>>>>>>>> Text
Container(
alignment: Alignment.centerLeft,child: Text("Data"),],);
},isExpanded: _item.isExpanded,body: GridView.count(
shrinkWrap: true,physics:
NeverScrollableScrollPhysics(),crossAxisCount: 4,children:[
//Some data
]
),);
}).toList(),
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)