SearchAnchor.bar constructor

SearchAnchor.bar(
  1. {Widget? barLeading,
  2. Iterable<Widget>? barTrailing,
  3. String? barHintText,
  4. GestureTapCallback? onTap,
  5. ValueChanged<String>? onSubmitted,
  6. ValueChanged<String>? onChanged,
  7. MaterialStateProperty<double?>? barElevation,
  8. MaterialStateProperty<Color?>? barBackgroundColor,
  9. MaterialStateProperty<Color?>? barOverlayColor,
  10. MaterialStateProperty<BorderSide?>? barSide,
  11. MaterialStateProperty<OutlinedBorder?>? barShape,
  12. MaterialStateProperty<EdgeInsetsGeometry?>? barPadding,
  13. MaterialStateProperty<TextStyle?>? barTextStyle,
  14. MaterialStateProperty<TextStyle?>? barHintStyle,
  15. Widget? viewLeading,
  16. Iterable<Widget>? viewTrailing,
  17. String? viewHintText,
  18. Color? viewBackgroundColor,
  19. double? viewElevation,
  20. BorderSide? viewSide,
  21. OutlinedBorder? viewShape,
  22. TextStyle? viewHeaderTextStyle,
  23. TextStyle? viewHeaderHintStyle,
  24. Color? dividerColor,
  25. BoxConstraints? constraints,
  26. BoxConstraints? viewConstraints,
  27. bool? isFullScreen,
  28. SearchController searchController,
  29. TextCapitalization textCapitalization,
  30. required SuggestionsBuilder suggestionsBuilder,
  31. TextInputAction? textInputAction,
  32. TextInputType? keyboardType}
)

Create a SearchAnchor that has a SearchBar which opens a search view.

All the barX parameters are used to customize the anchor. Similarly, all the viewX parameters are used to override the view's defaults.

This example shows how to use a SearchAnchor.bar which uses a default search bar to open a search view route.
link

To create a local project with this code sample, run:
flutter create --sample=material.SearchAnchor.bar.1 mysample

Implementation

factory SearchAnchor.bar({
  Widget? barLeading,
  Iterable<Widget>? barTrailing,
  String? barHintText,
  GestureTapCallback? onTap,
  ValueChanged<String>? onSubmitted,
  ValueChanged<String>? onChanged,
  MaterialStateProperty<double?>? barElevation,
  MaterialStateProperty<Color?>? barBackgroundColor,
  MaterialStateProperty<Color?>? barOverlayColor,
  MaterialStateProperty<BorderSide?>? barSide,
  MaterialStateProperty<OutlinedBorder?>? barShape,
  MaterialStateProperty<EdgeInsetsGeometry?>? barPadding,
  MaterialStateProperty<TextStyle?>? barTextStyle,
  MaterialStateProperty<TextStyle?>? barHintStyle,
  Widget? viewLeading,
  Iterable<Widget>? viewTrailing,
  String? viewHintText,
  Color? viewBackgroundColor,
  double? viewElevation,
  BorderSide? viewSide,
  OutlinedBorder? viewShape,
  TextStyle? viewHeaderTextStyle,
  TextStyle? viewHeaderHintStyle,
  Color? dividerColor,
  BoxConstraints? constraints,
  BoxConstraints? viewConstraints,
  bool? isFullScreen,
  SearchController searchController,
  TextCapitalization textCapitalization,
  required SuggestionsBuilder suggestionsBuilder,
  TextInputAction? textInputAction,
  TextInputType? keyboardType,
}) = _SearchAnchorWithSearchBar;