原因
flutter row布局嵌套row布局市容expanded填充水平方向的剩余空间时,外层控件无法计算子控件的实际宽度,导致这个问题
解决方案
使用IntrinsicWidth让外层控件智能计算一个最小宽度,一下使用伪代码解释
IntrinsicWidth(
child: Expanded(
child: Row(
children: [
Expanded(
flex: 1,
child: Text("¥9.9",
style: TextStyle(
fontSize: 14, color: AppTheme.red_1B))