StacListTile class

A Stac model for a fixed-height row that typically contains text, a leading or trailing icon, or other widgets. This model corresponds to Flutter's ListTile widget.

Use StacListTile to create items in a list.

Example:

StacListTile(
  leading: StacIcon(icon: StacIcons.album),
  title: StacText('The Enchanted Nightingale'),
  subtitle: StacText('Music by Julie Gable. Lyrics by Sidney Stein.'),
  trailing: StacIcon(icon: StacIcons.more_vert),
  onTap: StacAction(type: StacActionType.debugLog, args: {'message': 'Tapped on tile!'}),
  isThreeLine: true,
)
{
  "widget": "ListTile",
  "leading": {
    "widget": "Icon",
    "icon": "album"
  },
  "title": {
    "widget": "Text",
    "data": "The Enchanted Nightingale"
  },
  "subtitle": {
    "widget": "Text",
    "data": "Music by Julie Gable. Lyrics by Sidney Stein."
  },
  "trailing": {
    "widget": "Icon",
    "icon": "more_vert"
  },
  "onTap": {
    "type": "debugLog",
    "args": {"message": "Tapped on tile!"}
  },
  "isThreeLine": true
}

See also:

Inheritance
Available extensions
Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

StacListTile({StacWidget? leading, StacWidget? title, StacWidget? subtitle, StacWidget? trailing, bool? isThreeLine, bool? dense, StacVisualDensity? visualDensity, StacShapeBorder? shape, StacListTileStyle? style, String? selectedColor, String? iconColor, String? textColor, StacEdgeInsets? contentPadding, bool? enabled, StacAction? onTap, StacAction? onLongPress, StacMouseCursor? mouseCursor, bool? selected, String? focusColor, String? hoverColor, bool? autofocus, String? tileColor, String? selectedTileColor, bool? enableFeedback, double? horizontalTitleGap, double? minVerticalPadding, double? minLeadingWidth, StacListTileTitleAlignment? titleAlignment})
Creates a StacListTile with the given properties.
const
StacListTile.fromJson(Map<String, dynamic> json)
Creates a StacListTile from a JSON map.
factory

Properties

autofocus bool?
Whether this widget should automatically gain focus when it is visible.
final
contentPadding StacEdgeInsets?
The tile's internal padding.
final
dense bool?
Whether this list tile is part of a vertically dense list.
final
enabled bool?
Whether this list tile is interactive.
final
enableFeedback bool?
Whether detected gestures should provide acoustic and/or haptic feedback.
final
focusColor String?
The color for the tile's Material when it has the input focus.
final
hashCode int
The hash code for this object.
no setterinherited
horizontalTitleGap double?
The horizontal gap between the leading or trailing widget and the title and subtitle widgets.
final
hoverColor String?
The color for the tile's Material when a pointer is hovering over it.
final
iconColor String?
The color of the tile's icons when selected is false.
final
isThreeLine bool?
Whether this list tile is intended to display three lines of text.
final
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
leading StacWidget?
A widget to display before the title.
final
minLeadingWidth double?
The minimum width of the leading widget.
final
minVerticalPadding double?
The minimum padding on the top and bottom of the title and subtitle widgets.
final
mouseCursor StacMouseCursor?
The cursor for a mouse pointer when it enters or is hovering over the widget.
final
onLongPress StacAction?
An action to perform when the user long-presses this list tile.
final
onTap StacAction?
An action to perform when the user taps this list tile.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected bool?
Whether this tile is selected.
final
selectedColor String?
The color of the tile's text and icons when selected is true.
final
selectedTileColor String?
Defines the background color of the ListTile when selected is true.
final
shape StacShapeBorder?
The shape of the tile's InkWell.
final
style StacListTileStyle?
Defines the tile's visual style.
final
subtitle StacWidget?
Additional content displayed below the title.
final
textColor String?
The color of the tile's text when selected is false.
final
tileColor String?
Defines the background color of the ListTile when selected is false.
final
title StacWidget?
The primary content of the list tile.
final
titleAlignment StacListTileTitleAlignment?
Defines how the title and subtitle are vertically aligned relative to the leading and trailing widgets.
final
trailing StacWidget?
A widget to display after the title.
final
type String
Widget type identifier.
no setteroverride
visualDensity StacVisualDensity?
Defines the compactness of the list tile.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(BuildContext context) Widget?

Available on StacWidget?, provided by the StacWidgetParser extension

parsePreferredSizeWidget(BuildContext context) PreferredSizeWidget?

Available on StacWidget?, provided by the StacWidgetParser extension

toJson() Map<String, dynamic>
Converts this StacListTile instance to a JSON map.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited