showsCancelButton property

bool showsCancelButton
final

Whether to show the cancel button.

When true, the cancel button slides in from the right when the search bar is focused, matching iOS behavior. Set cancelButtonAlwaysVisible to keep it visible even without focus.

Defaults to false.

Implementation

final bool showsCancelButton;