Reference

SearchBar

SearchBar

SearchBar control. Build it with the search_bar helper.

Example

search_bar(
  value: "Sample",
  expand: true,
  width: 240,
  height: 120,
  on_change: ->(event) {}
)

Properties

  • autofocus — Requests focus when first shown.
  • bar_bgcolor — Bar background color.
  • bar_border_side
  • bar_elevation
  • bar_hint_text — Bar hint text.
  • bar_hint_text_style — Bar hint text style.
  • bar_leading
  • bar_overlay_color — Bar overlay color.
  • bar_padding — Bar padding.
  • bar_scroll_padding — Bar scroll padding.
  • bar_shadow_color — Bar shadow color.
  • bar_shape
  • bar_size_constraints
  • bar_text_style — Bar text style.
  • bar_trailing
  • capitalization
  • controls — The list of child controls.
  • divider_color — Divider color.
  • full_screen
  • keyboard_type — On-screen keyboard type (e.g. number, email).
  • shrink_wrap
  • value — The control's current value.
  • view_bar_padding — View bar padding.
  • view_bgcolor — View background color.
  • view_elevation
  • view_header_height — View header height.
  • view_header_text_style — View header text style.
  • view_hint_text — View hint text.
  • view_hint_text_style — View hint text style.
  • view_leading
  • view_padding — View padding.
  • view_shape
  • view_side
  • view_size_constraints
  • view_trailing

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_focus — Fired when the control gains focus.
  • on_size_change — Fired when the control's size changes.
  • on_submit — Fired when the input is submitted.
  • on_tap — Fired on a tap.
  • on_tap_outside_bar — Fired on tap outside bar.

Reference

  • Family: materials
  • Widget type: searchbar
  • Helper: search_bar