title: SearchDelegate<String> Key board action button press issue
body: <p>Search key board action in (<code>SearchDelegate&lt;&gt;</code> in flutter). When click search button in the key board it's showing error </p>
  
  <p>I just tried to call Search action button via Search Delegate.</p>
  
  <pre><code>class DataSearch extends SearchDelegate&lt;String&gt; {
  
    @override
    List&lt;Widget&gt;buildActions(BuildContext context) {
  
      return [
  
        Container(
          alignment: Alignment.topCenter,
          width: 1.0,
          color: Colors.grey,
          margin: const EdgeInsets.only(
              left: 8.0, top: 10.0, right: 0.0, bottom: 10.0),
        ),
  
        IconButton(
            icon: Icon(
              Icons.clear,
              size: 30,
            ),
            onPressed: () {
              query = "";
            }),
      ];
    }
  
    @override
    Widget buildLeading(BuildContext context) {
  
      return
        IconButton(
          icon: AnimatedIcon(
            icon: AnimatedIcons.menu_arrow,
            progress: transitionAnimation,
          ),
          onPressed: () {
            close(context, null);
          },
        );
    }
  
    @override
    Widget buildResults(BuildContext context) {}
  
    @override
    Widget buildSuggestions(BuildContext context) {
  
      return Container();
    }
  }
  </code></pre>
  
  <p>it's showing an error page</p>