Widgets

Draggable

Draggable

Draggable control. Build it with the draggable helper.

Example

draggable(
  content: text("Draggable"),
  expand: true,
  on_drag_complete: ->(event) {}
)

Properties

  • affinity — Sets the affinity property.
  • axis — Sets the axis property.
  • content — The single child control rendered inside this control.
  • content_feedback — Sets the content feedback property.
  • content_when_dragging — Sets the content when dragging property.
  • group — Sets the group property.
  • max_simultaneous_drags — Sets the max simultaneous drags property.

Common layout and animation properties

  • badge — Badge drawn on the corner of the control.
  • 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.
  • key — Stable identity used to preserve state across rebuilds.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • rtl — Renders right-to-left when true.
  • tooltip — Text shown on hover/long-press.
  • visible — Hides the control when false.

Events

  • on_drag_complete — Fired on drag complete.
  • on_drag_start — Fired when a drag begins.

Reference

  • Family: shared
  • Widget type: draggable
  • Helpers: draggable