1.Row - Column - Row - Text 嵌套情况下会出现这个问题
1.附代码,参考注释部分的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/