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. double? viewHeaderHeight,
  23. TextStyle? viewHeaderTextStyle,
  24. TextStyle? viewHeaderHintStyle,
  25. Color? dividerColor,
  26. BoxConstraints? constraints,
  27. BoxConstraints? viewConstraints,
  28. bool? isFullScreen,
  29. SearchController searchController,
  30. TextCapitalization textCapitalization,
  31. required SuggestionsBuilder suggestionsBuilder,
  32. TextInputAction? textInputAction,
  33. TextInputType? keyboardType,
  34. EdgeInsets scrollPadding,
  35. EditableTextContextMenuBuilder contextMenuBuilder,
})

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.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,
  double? viewHeaderHeight,
  TextStyle? viewHeaderTextStyle,
  TextStyle? viewHeaderHintStyle,
  Color? dividerColor,
  BoxConstraints? constraints,
  BoxConstraints? viewConstraints,
  bool? isFullScreen,
  SearchController searchController,
  TextCapitalization textCapitalization,
  required SuggestionsBuilder suggestionsBuilder,
  TextInputAction? textInputAction,
  TextInputType? keyboardType,
  EdgeInsets scrollPadding,
  EditableTextContextMenuBuilder contextMenuBuilder,
}) = _SearchAnchorWithSearchBar;