Widgets

NavigationDrawer

NavigationDrawer

NavigationDrawer control. Build it with the navigation_drawer helper.

Example

navigation_drawer(
  bgcolor: :surface_container_high,
  expand: true,
  width: 240,
  on_change: ->(event) {}
)

Properties

  • adaptive — Adapts to the platform (Material/Cupertino) when true.
  • bgcolor — Background color.
  • controls — The list of child controls.
  • elevation — Shadow depth (z-height).
  • indicator_color — Indicator color.
  • indicator_shape — Sets the indicator shape property.
  • selected_index — Sets the selected index property.
  • shadow_color — Color of the drop shadow.
  • surface_tint_color — Surface tint color.
  • tile_padding — Tile padding.

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.
  • width — Fixed width in logical pixels.

Events

  • on_change — Fired when the value changes.
  • on_dismiss — Fired when the control is dismissed.

Reference

  • Family: materials
  • Widget type: navigationdrawer
  • Helpers: navigation_drawer, navigationdrawer