Widgets

InteractiveViewer

InteractiveViewer

InteractiveViewer control. Build it with the interactive_viewer helper.

Example

interactive_viewer(
  content: text("InteractiveViewer"),
  expand: true,
  width: 240,
  height: 120,
  on_animation_end: ->(event) {}
)

Properties

  • alignment — Alignment of the content within the control.
  • boundary_margin — Sets the boundary margin property.
  • clip_behavior — How content overflowing the bounds is clipped.
  • constrained — Sets the constrained property.
  • content — The single child control rendered inside this control.
  • interaction_end_friction_coefficient — Sets the interaction end friction coefficient property.
  • interaction_update_interval — Sets the interaction update interval property.
  • max_scale — Sets the max scale property.
  • min_scale — Sets the min scale property.
  • pan_enabled — Sets the pan enabled property.
  • scale_enabled — Sets the scale enabled property.
  • scale_factor — Sets the scale factor property.
  • trackpad_scroll_causes_scale — Sets the trackpad scroll causes scale 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_interaction_end — Fired on interaction end.
  • on_interaction_start — Fired on interaction start.
  • on_interaction_update — Fired on interaction update.
  • on_size_change — Fired when the control's size changes.

Methods

  • pan(dx, dy: ..., dz: ..., timeout: ..., on_result: ...)
  • reset(animation_duration: ..., timeout: ..., on_result: ...)
  • restore_state(timeout: ..., on_result: ...)
  • save_state(timeout: ..., on_result: ...)
  • zoom(factor, timeout: ..., on_result: ...)

Reference

  • Family: shared
  • Widget type: interactiveviewer
  • Helpers: interactive_viewer, interactiveviewer