Flutter:在ListTile中的标题和副标题之间添加空格

rjee0c15  于 2023-05-29  发布在  Flutter
关注(0)|答案(3)|浏览(192)

如何在ListTile中的titlesubtitle之间添加空格?

ListTile(
 title: Text(" xxxxxxxx"),
 subtitle: Text("From: to"),
),
0h4hbjxa

0h4hbjxa1#

您可以将titleText小部件封装到Padding小部件中,并传递您想要的间距paddingbottom,如下所示:

ListTile(
          title: Padding(
            padding: const EdgeInsets.only(bottom: 15.0),
            child: Text("title"),
          ),
          subtitle: Text("Subtitle"),
        )
8ftvxx2r

8ftvxx2r2#

ListTile(
          title: Padding(
            padding: const EdgeInsets.only(bottom: 10.0),
            child:  Text(" xxxxxxxx"),,
          ),
          subtitle:Text("From: to"),
        )
eiee3dmh

eiee3dmh3#

你可以给予height属性,在Text样式中,在subtitle中添加,在title和subtitle之间添加空间。

ListTile(
      title: Text("xxxxx", 
              style: TextStyle(fontSize: 18),
                 ),   
      subtitle: Text("xxxxxx"
                 style: TextStyle(fontSize: 16, height: 2),
                ),
),

相关问题