Skip to main content
The Stac ListTile allows you to build a Flutter ListTile widget using JSON. To know more about the list tile widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
onTapStacActionCalled when the user taps this list tile.
onLongPressStacActionCalled when the user long-presses on this list tile.
leadingStacWidgetA widget to display before the title.
titleStacWidgetThe primary content of the list tile.
subtitleStacWidgetAdditional content displayed below the title.
trailingStacWidgetA 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.
styleStacListTileStyleDefines the font used for the title.
selectedColorStacColorDefines the color used for icons and text when the list tile is selected.
iconColorStacColorDefines the default color for leading and trailing icons.
textColorStacColorDefines 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.
focusColorStacColorThe color for the tile’s Material when it has the input focus.
hoverColorStacColorThe color for the tile’s Material when a pointer is hovering over it.
autoFocusboolTrue if this widget will be selected as the initial focus when no other node in its scope is currently focused.
tileColorStacColorDefines the background color of ListTile when selected is false.
selectedTileColorStacColorDefines 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

StacColumn(
  mainAxisAlignment: StacMainAxisAlignment.start,
  crossAxisAlignment: StacCrossAxisAlignment.center,
  children: [
    StacSizedBox(height: 12),
    StacListTile(
      leading: StacImage(src: 'https://cdn-icons-png.flaticon.com/512/3135/3135715.png'),
      title: StacPadding(
        padding: StacEdgeInsets(top: 10),
        child: StacText(
          data: 'Andrew Symonds',
          style: StacTextStyle(fontSize: 18),
        ),
      ),
      subtitle: StacPadding(
        padding: StacEdgeInsets(top: 10),
        child: StacText(
          data: 'Andrew Symonds was an Australian international cricketer...',
          style: StacTextStyle(fontSize: 14),
        ),
      ),
      trailing: StacIcon(iconType: 'material', icon: 'more_vert', size: 24),
    ),
    StacSizedBox(height: 12),
    StacListTile(
      leading: StacImage(src: 'https://cdn-icons-png.flaticon.com/512/3135/3135715.png'),
      title: StacPadding(
        padding: StacEdgeInsets(top: 10),
        child: StacText(
          data: 'Adam Gilchrist',
          style: StacTextStyle(fontSize: 18),
        ),
      ),
      subtitle: StacPadding(
        padding: StacEdgeInsets(top: 10),
        child: StacText(
          data: 'Adam Craig Gilchrist is an Australian cricket commentator...',
          style: StacTextStyle(fontSize: 14),
        ),
      ),
      trailing: StacIcon(iconType: 'material', icon: 'more_vert', size: 24),
    ),
  ],
)