Widgets

ListTile

ListTile

A single fixed-height row with optional leading/trailing controls, a title, and a subtitle — the building block of lists and menus.

Example

list_tile(
  leading: icon("person"),
  title: text("Ada Lovelace"),
  subtitle: text("Engineer"),
  trailing: icon_button("chevron_right", on_click: ->(_e) { open_profile }),
  on_click: ->(_e) { open_profile }
)

Common properties

  • title
  • subtitle
  • leading / trailing
  • dense
  • is_three_line
  • content_padding
  • bgcolor / hover_color
  • selected / selected_color / selected_tile_color
  • shape
  • url — open a URL on tap

Usage

list_tile is commonly the child of a list_view or column:

column(children: people.map { |p| list_tile(title: text(p.name)) })

Complete API

Helpers

  • list_tile(**props)
  • listtile(**props)

Accepted properties

  • adaptive — Adapts to the platform (Material/Cupertino) when true.
  • align — Alignment of the control within its parent.
  • animate_align — Animates alignment changes.
  • animate_margin — Animates margin changes.
  • animate_offset — Animates offset changes.
  • animate_opacity — Animates opacity changes.
  • animate_position — Animates position changes.
  • animate_rotation — Animates rotation changes.
  • animate_scale — Animates scale changes.
  • animate_size — Animates size changes.
  • aspect_ratio — Width-to-height ratio to maintain.
  • autofocus — Requests focus when first shown.
  • badge — Badge drawn on the corner of the control.
  • bgcolor — Background color.
  • bottom — Bottom offset when positioned inside a stack.
  • col — Responsive column span (1-12) per breakpoint.
  • content_padding — Content padding.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • dense — Sets the dense property.
  • disabled — Disables interaction when true.
  • enable_feedback — Plays touch feedback (sound/haptic) on interaction.
  • expand — Fills the available space along the parent's main axis when true.
  • expand_loose — Like expand, but only grows up to the child's natural size.
  • height — Fixed height in logical pixels.
  • horizontal_spacing — Sets the horizontal spacing property.
  • hover_color — Color shown while hovered.
  • icon_color — Color of the icon.
  • is_three_line — Sets the is three line property.
  • key — Stable identity used to preserve state across rebuilds.
  • leading — Control placed before the main content (e.g. an icon or avatar).
  • leading_and_trailing_text_style — Leading and trailing text style.
  • left — Left offset when positioned inside a stack.
  • margin — Outer spacing around the control.
  • min_height — Min height.
  • min_leading_width — Min leading width.
  • min_vertical_padding — Min vertical padding.
  • mouse_cursor — Cursor shown when hovering the control.
  • offset — Translation offset applied to the control.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • right — Right offset when positioned inside a stack.
  • rotate — Rotation applied to the control.
  • rtl — Renders right-to-left when true.
  • scale — Scale transform applied to the control.
  • selected — Whether the control is selected.
  • selected_color — Selected color.
  • selected_tile_color — Selected tile color.
  • shape — Shape/border of the control.
  • size_change_interval — Throttle interval for on_size_change, in ms.
  • splash_color — Splash color.
  • style — Style overrides for the control.
  • subtitle — The control shown as the secondary line below the title.
  • subtitle_text_style — Subtitle text style.
  • text_color — Text color.
  • title — The control shown as the title.
  • title_alignment — Title alignment.
  • title_text_style — Title text style.
  • toggle_inputs — Sets the toggle inputs property.
  • tooltip — Text shown on hover/long-press.
  • top — Top offset when positioned inside a stack.
  • trailing — Control placed after the main content.
  • url — URL the control loads or links to.
  • visible — Hides the control when false.
  • visual_density — Compactness of the control's layout.
  • width — Fixed width in logical pixels.

Events

  • on_animation_end — Fired when an animation completes.
  • on_click — Fired when the control is clicked/tapped.
  • on_long_press — Fired on a long press.
  • on_size_change — Fired when the control's size changes.

Wire reference

  • Family: materials
  • Widget type: listtile