Widgets

Row

Row

A horizontal layout control for arranging children in a line.

Example

row(
  spacing: 8,
  alignment: Ruflet::MainAxisAlignment::CENTER,
  children: [
    icon("add"),
    text(value: "Create")
  ]
)

Common properties

  • children
  • spacing
  • alignment
  • vertical_alignment
  • expand

Usage

row(
  spacing: 10,
  children: [
    filled_button(content: text(value: "Save")),
    outlined_button(content: text(value: "Cancel"))
  ]
)

Notes

  • alignment controls main-axis placement
  • row is usually paired with column and container

Complete API

Helpers

  • row(children = ..., **props, &block)

Accepted properties

  • adaptive — Adapts to the platform (Material/Cupertino) when true.
  • align — Alignment of the control within its parent.
  • alignment — Alignment of the content within the control.
  • 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.
  • auto_scroll — Sets the auto scroll property.
  • 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.
  • controls — The list of child controls.
  • 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.
  • intrinsic_height — Intrinsic height.
  • 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.
  • run_alignment — Run alignment.
  • run_spacing — Sets the run spacing property.
  • scale — Scale transform applied to the control.
  • scroll — Sets the scroll property.
  • scroll_interval — Sets the scroll interval property.
  • size_change_interval — Throttle interval for on_size_change, in ms.
  • spacing — Sets the spacing property.
  • tight — Sets the tight property.
  • tooltip — Text shown on hover/long-press.
  • top — Top offset when positioned inside a stack.
  • vertical_alignment — Vertical alignment.
  • visible — Hides the control when false.
  • width — Fixed width in logical pixels.
  • wrap — Sets the wrap property.

Events

  • on_animation_end — Fired when an animation completes.
  • on_scroll — Fired when the scroll position changes.
  • on_size_change — Fired when the control's size changes.

Wire reference

  • Family: shared
  • Widget type: row