title: Flutter search delegate doesn't work when navigate back from a route
body: <p>I'm using Flutter SearchDelegate in my app and here's the code:</p>
  
  <pre><code>class NameSearch extends SearchDelegate&lt;String&gt; {
      @override
      List&lt;Widget&gt; buildActions(BuildContext context) {
      return [
        IconButton(
          icon: Icon(Icons.clear),
          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) {
       return null;
      }
  
      @override
      Widget buildSuggestions(BuildContext context) {
      suggestionList = query.isEmpty ? [] : List.generate(nameList.length,
       (i) =&gt; nameList[i]).where((p) =&gt; p.name.startsWith(query)).toList();
  
      return ListView.builder(
        itemBuilder: (context, index) =&gt; ListTile(
              onTap: () {
                Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) =&gt; DetailScreen(
                              detail: suggestionList[index],
                            )));
              },
              leading: Icon(Icons.book),
              title: RichText(
                text: TextSpan(
                    text: suggestionList[index].name.substring(0, query.length),
                    style: TextStyle(
                        color: Colors.black, fontWeight: FontWeight.bold),
                    children: [
                      TextSpan(
                          text: suggestionList[index].name.substring(query.length),
                          style: TextStyle(color: Colors.grey))
                    ]),
              ),
            ),
        itemCount: suggestionList.length,
      );
      }
  }
  </code></pre>
  
  <p>When I clicked on an item in a suggestion list, It gets me to the new detail screen and works properly. But when I want to back to the search screen, the text input become like that:
  <img src="https://i.stack.imgur.com/yGN5N.png" alt="search screen"></p>
  
  <p>And I can't insert any text anymore, till restart the app or go to another page and after that go back to search page again!</p>
  
  <p>And here is my DetailScreen code:</p>
  
  <pre><code>class DetailScreen extends StatelessWidget {
      final BookDetail detail;
      DetailScreen({Key key, @required this.detail}) : super(key: key);
  
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
          title: Text(detail.name),
        ),
        body: Padding(
          padding: EdgeInsets.all(16.0),
          child: Text(detail.description),
        ),
      );
      }
  }
  </code></pre>