Reference

DropdownM2

DropdownM2

DropdownM2 control. Build it with the dropdown_m2 helper.

Example

dropdown_m2(
  value: "Sample",
  label: "Label",
  icon: "add",
  options: [],
  on_click: ->(event) {}
)

Properties

  • align_label_with_hint
  • alignment — Alignment of the content within the control.
  • autofocus — Requests focus when first shown.
  • bgcolor — Background color.
  • border — Border definition.
  • border_color — Border color.
  • border_radius — Corner radius.
  • border_width — Border thickness.
  • collapsed
  • color — Foreground color.
  • content_padding — Content padding.
  • counter
  • counter_style — Counter style.
  • dense
  • disabled_hint_content
  • elevation — Shadow depth (z-height).
  • enable_feedback — Plays touch feedback (sound/haptic) on interaction.
  • error
  • error_max_lines
  • error_style — Error style.
  • fill_color — Fill color.
  • filled
  • fit_parent_size
  • focus_color — Color shown while focused.
  • focused_bgcolor — Focused background color.
  • focused_border_color — Focused border color.
  • focused_border_width — Focused border width.
  • focused_color — Focused color.
  • helper
  • helper_max_lines
  • helper_style — Helper style.
  • hint_content
  • hint_fade_duration
  • hint_max_lines
  • hint_style — Hint style.
  • hint_text — Placeholder shown when the field is empty.
  • hover_color — Color shown while hovered.
  • icon — Icon name shown by the control.
  • item_height — Item height.
  • label — Text label shown for the control.
  • label_style — Label style.
  • max_menu_height — Max menu height.
  • options — The selectable options (built with the control's option helper).
  • options_fill_horizontally
  • padding — Inner spacing between the border and the content.
  • prefix
  • prefix_icon — Prefix icon.
  • prefix_icon_size_constraints
  • prefix_style — Prefix style.
  • select_icon — Select icon.
  • select_icon_disabled_color — Select icon disabled color.
  • select_icon_enabled_color — Select icon enabled color.
  • select_icon_size
  • size_constraints — Min/max size constraints.
  • suffix
  • suffix_icon — Suffix icon.
  • suffix_icon_size_constraints
  • suffix_style — Suffix style.
  • text_size
  • text_style — Text style.
  • text_vertical_align
  • value — The control's current value.

Plus the common layout and animation properties shared by most controls (expand, visible, disabled, opacity, width, height, align, tooltip, animate_*, …).

Events

  • on_animation_end — Fired when an animation completes.
  • on_blur — Fired when the control loses focus.
  • on_change — Fired when the value changes.
  • on_click — Fired when the control is clicked/tapped.
  • on_focus — Fired when the control gains focus.
  • on_size_change — Fired when the control's size changes.

Reference

  • Family: materials
  • Widget type: dropdownm2
  • Helper: dropdown_m2