简体   繁体   English

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

[英]Flutter : add a space between title and subtitle in ListTile

How can I add a space between title and subtitle in ListTile ?如何在ListTiletitlesubtitle之间添加空格?

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

You can wrap your Text widget of title into Padding widget and pass padding bottom of your desired gap like below:您可以将titleText小部件包装到Padding小部件中,并传递所需间隙的padding bottom ,如下所示:

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

You can use SizedBox widget with it's height property also between your title and subtitle .您也可以在titlesubtitle之间使用具有height属性的SizedBox小部件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM