Fatima ELKADDOURI
Fatima ELKADDOURI

Reputation: 185

Flutter : add a space between title and subtitle in ListTile

How can I add a space between title and subtitle in ListTile ?

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

Upvotes: 11

Views: 14312

Answers (3)

Priyanshi Pandya
Priyanshi Pandya

Reputation: 47

You can give height property, in the style of Text, add in the subtitle to add space between title and subtitle.

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

Upvotes: 4

Poran
Poran

Reputation: 612

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

Upvotes: 5

Diwyansh
Diwyansh

Reputation: 3514

You can wrap your Text widget of title into Padding widget and pass padding bottom of your desired gap like below :

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

Upvotes: 17

Related Questions