列小部件上的颤动文本溢出

时间:2021-01-10 18:14:03

标签: flutter

我正在使用行小部件,其中我在列中显示文本。但问题是它溢出了文本的宽度。

我的代码

    Padding(
        padding: const EdgeInsets.all(20.0),
        child: Row(
          children: [
            Image.asset(
              'images/preinform-battery-screen-icon@2x.png',
              height: height * 0.045,
            ),
            Padding(
              padding: const EdgeInsets.only(left: 20),
              child: Column(
                children: [
                  Expanded(
                      child: Text(
                    'KMC-216, TOHEED COLONY, SECTOR 11, BLOCK L, ST6, KARACHI, ABC, XYZ, DMG',
                    style: TextStyle(
                      fontSize: 17,
                      fontFamily: 'UbuntuRegular',
                    ),
                  )),
                  SizedBox(
                    height: height * 0.007,
                  ),
                  Text(
                    'Home Adress',
                    style: TextStyle(
                        fontSize: 17,
                        fontFamily: 'UbuntuRegular',
                        color: Colors.grey),
                  ),
                ],
              ),
            )
          ],
        ),
      ),

enter image description here

我想在左边显示文本而不是溢出

1 个答案:

答案 0 :(得分:2)

您可以将 printf -v spaces "%*s" $n "" newlines=${spaces// /$'\n'} 的所有子项包装在 RowFlexible 小部件中。
这是预览:

enter image description here

您可以访问预览和代码 here