getSearchAction method

IconButton getSearchAction(
  1. BuildContext context
)

Returns an IconButton suitable for an Action

Put this inside your buildDefaultAppBar method!

Implementation

IconButton getSearchAction(BuildContext context) {
  return IconButton(
      icon: Icon(Icons.search),
      onPressed: () {
        beginSearch(context);
      });
}