buildLeading method Null safety

Widget? buildLeading(
  1. BuildContext context
)

A widget to display before the current query in the AppBar.

Typically an IconButton configured with a BackButtonIcon that exits the search with close. One can also use an AnimatedIcon driven by transitionAnimation, which animates from e.g. a hamburger menu to the back button as the search overlay fades in.

Returns null if no widget should be shown.

See also:

  • AppBar.leading, the intended use for the return value of this method.

Implementation

Widget? buildLeading(BuildContext context);