如何在 ExpansionPanel 内的 headerBuilder 上应用背景图像 - Flutter

问题描述

我正在尝试设置 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(),

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...