我想用剩余空间修复Right Text,Left Text

时间:2019-07-26 10:19:57

标签: flutter

我有两个小部件:文本A,文本B,文本A是很长的文本, B是正确的,我想固定B的位置并使其完全可见,然后让A小部件使用剩余空间和换行符来显示B文本。

enter image description here

代码如下:

Row(
            children: <Widget>[
              Text('AAAAAAAAAAAA--------------------------------------------------------'),
              //Spacer(),
              Text(
                "BBBBBBBBB",
                style: TextStyle(fontSize: 13, color: Color(0xFF666666)),
              )
            ],
          )

1 个答案:

答案 0 :(得分:0)

 Row(
        children: <Widget>[
          Expanded(child: Text(
              'AAAAAAAAAAAA---------------------------------------------------------------------------------------------------')),
          //Spacer(),
          Text(
            "BBBBBBBBB",
            style: TextStyle(fontSize: 13, color: Color(0xFF666666)),
          )
        ],
      )
相关问题