1.Row  - Column - Row - Text 嵌套情况下会出现这个问题

2.附代码,参考注释部分的Expanded使用,

Container(
        padding: EdgeInsets.all(2),
        decoration: BoxDecoration(
          color: Colors.black38,
        ),
        child: Row(
          children: [
            Container(
              padding: EdgeInsets.all(10),
              width: 100,
              height: 100,
              child: Image.network(
                value['propertyImg'],
                fit: BoxFit.cover,
              ),
            ),
            // 超出元素的父级元素采用 Expanded
            Expanded(
              child: Container(
                height: 98,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Container(
                      child: Text24(
                        text: value['propertyName'],
                      ),
                    ),
                    Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisSize: MainAxisSize.min,
                      children: <Widget>[
                        // 超出文字 采用Expanded
                        Expanded(
                          child: Text16(
                            text: value['propertyDesc'],
                          ),
                        )
                      ],
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),

 

源: https://www.tongbiao.xyz/

其他:https://blog.csdn.net/u014627313/article/details/102729213

 

相关文章:

  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2021-07-06
  • 2021-10-29
  • 2021-09-04
  • 2021-09-16
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案