如何对齐颤振列小部件中的文本?

Ram*_*uam 6 flutter

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

在此输入图像描述

         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"),
         )

       ]),
       ),
         );
Run Code Online (Sandbox Code Playgroud)

小智 20

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

Text('my String', textAlign: TextAlign.justify),
Run Code Online (Sandbox Code Playgroud)


KuK*_*uKu 1

您会尝试用 Padding 小部件包裹第二行吗?

Padding(
    padding: EdgetInsets.symmetric(horizontal: 18.0),
    child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children:<Widget> [
              Text(
              product.description,
              style: theme.textTheme.subtitle,
              maxLines: 1,

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

       ]),
)
Run Code Online (Sandbox Code Playgroud)