SearchBar constructor

const SearchBar({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. String? hintText,
  5. Widget? leading,
  6. Iterable<Widget>? trailing,
  7. GestureTapCallback? onTap,
  8. TapRegionCallback? onTapOutside,
  9. ValueChanged<String>? onChanged,
  10. ValueChanged<String>? onSubmitted,
  11. BoxConstraints? constraints,
  12. MaterialStateProperty<double?>? elevation,
  13. MaterialStateProperty<Color?>? backgroundColor,
  14. MaterialStateProperty<Color?>? shadowColor,
  15. MaterialStateProperty<Color?>? surfaceTintColor,
  16. MaterialStateProperty<Color?>? overlayColor,
  17. MaterialStateProperty<BorderSide?>? side,
  18. MaterialStateProperty<OutlinedBorder?>? shape,
  19. MaterialStateProperty<EdgeInsetsGeometry?>? padding,
  20. MaterialStateProperty<TextStyle?>? textStyle,
  21. MaterialStateProperty<TextStyle?>? hintStyle,
  22. TextCapitalization? textCapitalization,
  23. bool enabled = true,
  24. bool autoFocus = false,
  25. TextInputAction? textInputAction,
  26. TextInputType? keyboardType,
  27. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  28. EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
})

Creates a Material Design search bar.

Implementation

const SearchBar({
  super.key,
  this.controller,
  this.focusNode,
  this.hintText,
  this.leading,
  this.trailing,
  this.onTap,
  this.onTapOutside,
  this.onChanged,
  this.onSubmitted,
  this.constraints,
  this.elevation,
  this.backgroundColor,
  this.shadowColor,
  this.surfaceTintColor,
  this.overlayColor,
  this.side,
  this.shape,
  this.padding,
  this.textStyle,
  this.hintStyle,
  this.textCapitalization,
  this.enabled = true,
  this.autoFocus = false,
  this.textInputAction,
  this.keyboardType,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.contextMenuBuilder = _defaultContextMenuBuilder,
});