Widgets

DataTable

DataTable

DataTable control. Build it with the data_table helper.

Example

data_table(
  bgcolor: :surface_container_high,
  expand: true,
  width: 240,
  height: 120,
  on_animation_end: ->(event) {}
)

Properties

  • bgcolor — Background color.
  • border — Border definition.
  • border_radius — Corner radius.
  • checkbox_horizontal_margin — Sets the checkbox horizontal margin property.
  • clip_behavior — How content overflowing the bounds is clipped.
  • column_spacing — Sets the column spacing property.
  • columns — Sets the columns property.
  • data_row_color — Data row color.
  • data_row_max_height — Data row max height.
  • data_row_min_height — Data row min height.
  • data_text_style — Data text style.
  • divider_thickness — Sets the divider thickness property.
  • gradient — Sets the gradient property.
  • heading_row_color — Heading row color.
  • heading_row_height — Heading row height.
  • heading_text_style — Heading text style.
  • horizontal_lines — Sets the horizontal lines property.
  • horizontal_margin — Sets the horizontal margin property.
  • rows — Sets the rows property.
  • show_bottom_border — Sets the show bottom border property.
  • show_checkbox_column — Sets the show checkbox column property.
  • sort_ascending — Sets the sort ascending property.
  • sort_column_index — Sets the sort column index property.
  • vertical_lines — Sets the vertical lines property.

Common layout and animation properties

  • 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.
  • badge — Badge drawn on the corner of the control.
  • bottom — Bottom offset when positioned inside a stack.
  • col — Responsive column span (1-12) per breakpoint.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • disabled — Disables interaction when true.
  • 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.
  • key — Stable identity used to preserve state across rebuilds.
  • left — Left offset when positioned inside a stack.
  • margin — Outer spacing around 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.
  • size_change_interval — Throttle interval for on_size_change, in ms.
  • tooltip — Text shown on hover/long-press.
  • top — Top offset when positioned inside a stack.
  • visible — Hides the control when false.
  • width — Fixed width in logical pixels.

Events

  • on_animation_end — Fired when an animation completes.
  • on_select_all — Fired on select all.
  • on_size_change — Fired when the control's size changes.

Reference

  • Family: materials
  • Widget type: datatable
  • Helpers: data_table, datatable