首页 > 解决方案 > 如何证明颤动列小部件中的文本?

问题描述

我想用填充垂直对齐左侧元素并且与右侧元素相同,这是我得到的结果,元素未对齐,我无法在第二行中插入填充,以便左侧元素对齐

在此处输入图像描述

         return InkWell(
           child: Column(

            children: <Widget>[
               Row(
                 children:<Widget> [
                 Padding(padding:EdgeInsets.fromLTRB(18.0, 0.0, 0.0, 0.0)),

                 Text(
                 product.libelle,
                 style: theme.textTheme.title,
                 maxLines: 1,
                 textAlign: TextAlign.left,
                 ),]),


             Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children:<Widget> [
              Text(
              product.description,
              style: theme.textTheme.subtitle,
              maxLines: 1,

             ),
         RaisedButton( onPressed: () {},
         child: new Text("S\'abonner"),
         )

       ]),
       ),
         );

标签: flutter

解决方案


使用文本小部件和 TextAlign.justify :)

Text('my String', textAlign: TextAlign.justify),

推荐阅读