Skip to main content

ListTile

Stac list tile allows you to build the Flutter list tile widget using JSON. To know more about the list tile widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
onTapMap<String,dynamic>Called when the user taps this list tile.
onLongPressMap<String,dynamic>Called when the user long-presses on this list tile.
leadingMap<String,dynamic>A widget to display before the title.
titleMap<String,dynamic>The primary content of the list tile.
subtitleMap<String,dynamic>Additional content displayed below the title.
trailingMap<String,dynamic>A widget to display after the title.
isThreeLineboolWhether this list tile is intended to display three lines of text.
denseboolWhether this list tile is part of a vertically dense list.
styleListTileStyleDefines the font used for the title.
selectedColorStringDefines the color used for icons and text when the list tile is selected.
iconColorStringDefines the default color for leading and trailing icons.
textColorStringDefines the text color for the title, subtitle, leading, and trailing.
contentPaddingStacEdgeInsetsThe tile's internal padding.
enabledboolWhether this list tile is interactive.
selectedboolIf this tile is also enabled then icons and text are rendered with the same color.
focusColorStringThe color for the tile's Material when it has the input focus.
hoverColorStringThe color for the tile's Material when a pointer is hovering over it.
autoFocusStringTrue if this widget will be selected as the initial focus when no other node in its scope is currently focused.
tileColorStringDefines the background color of ListTile when selected is false.
selectedTileColorStringDefines the background color of ListTile when selected is true.
enableFeedbackboolWhether detected gestures should provide acoustic and/or haptic feedback.
horizontalTitleGapdoubleThe horizontal gap between the titles and the leading/trailing widgets.
minVerticalPaddingdoubleThe minimum padding on the top and bottom of the title and subtitle widgets.
minLeadingWidthdoubleThe minimum width allocated for the ListTile.leading widget.

Example JSON​

{
"type": "column",
"mainAxisAlignment": "start",
"crossAxisAlignment": "center",
"children": [
{
"type": "sizedBox",
"height": 12
},
{
"type": "listTile",
"leading": {
"type": "image",
"src": "https://cdn-icons-png.flaticon.com/512/3135/3135715.png"
},
"title": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Andrew Symonds",
"style": {
"fontSize": 18
}
}
},
"subtitle": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Andrew Symonds was an Australian international cricketer, who played all three formats as a batting all-rounder. Commonly nicknamed \"Roy\", he was a key member of two World Cup winning squads. Symonds played as a right-handed, middle order batsman and alternated between medium pace and off-spin",
"style": {
"fontSize": 14
}
}
},
"trailing": {
"type": "icon",
"iconType": "material",
"icon": "more_vert",
"size": 24
}
},
{
"type": "sizedBox",
"height": 12
},
{
"type": "listTile",
"leading": {
"type": "image",
"src": "https://cdn-icons-png.flaticon.com/512/3135/3135715.png"
},
"title": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Adam Gilchrist",
"style": {
"fontSize": 18
}
}
},
"subtitle": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Adam Craig Gilchrist is an Australian cricket commentator and former international cricketer and captain of the Australia national cricket team. He was an attacking left-handed batsman and record-breaking wicket-keeper",
"style": {
"fontSize": 14
}
}
},
"trailing": {
"type": "icon",
"iconType": "material",
"icon": "more_vert",
"size": 24
}
}
]
}