showsCancelButton property

bool showsCancelButton
final

Whether to show a cancel/dismiss button when the search bar is focused.

Defaults to true, providing an intuitive escape hatch for users to dismiss the keyboard and search state. Note that if true, it renders a detached glass dismiss pill with an "X" icon, replicating Apple News.

Implementation

final bool showsCancelButton;