title: How to debounce search suggestions in flutter's SearchPage Widget?
body: <p>I need to have Google Places search suggestions using the default flutter's <strong>SearchPage</strong>, whenever the user starts typing I need to give autocomplete suggestions and I achieve this Asynchronously using <code>FutureBuilder</code>, the problem now is that I need to debounce the dispatch of search requests for 500ms or more rather than wasting a lot of requests while the user is still typing</p>
  
  <p>To summarize what I've done so far:</p>
  
  <p>1) In my widget I call </p>
  
  <pre><code>showSearch(context: context, delegate: _delegate);
  </code></pre>
  
  <p>2) My delegate looks like this:</p>
  
  <pre><code>class _LocationSearchDelegate extends SearchDelegate&lt;Suggestion&gt; {   
    @override
    List&lt;Widget&gt; buildActions(BuildContext context) {
      return &lt;Widget&gt;[
        IconButton(
          tooltip: 'Clear',
          icon: const Icon(Icons.clear),
          onPressed: () {
            query = '';
            showSuggestions(context);
          },
        )
      ];
    }
  
    @override
    Widget buildLeading(BuildContext context) =&gt; IconButton(
          tooltip: 'Back',
          icon: AnimatedIcon(
            icon: AnimatedIcons.menu_arrow,
            progress: transitionAnimation,
          ),
          onPressed: () {
            close(context, null);
          },
        );
  
    @override
    Widget buildResults(BuildContext context) {
      return FutureBuilder&lt;List&lt;Suggestion&gt;&gt;(
        future: GooglePlaces.getInstance().getAutocompleteSuggestions(query),
        builder: (BuildContext context, AsyncSnapshot&lt;List&lt;Suggestion&gt;&gt; suggestions) {
          if (!suggestions.hasData) {
            return Text('No results');
          }
          return buildLocationSuggestions(suggestions.data);
        },
      );
    }
  
    @override
    Widget buildSuggestions(BuildContext context) {
      return buildResults(context);
    }
  
    Widget buildLocationSuggestions(List&lt;Suggestion&gt; suggestions) {
      return ListView.builder(
        itemBuilder: (context, index) =&gt; ListTile(
              leading: Icon(Icons.location_on),
              title: Text(suggestions[index].text),
              onTap: () {
                showResults(context);
              },
            ),
        itemCount: suggestions.length,
      );
    }
  }
  </code></pre>
  
  <p>3-I need to throttle / debounce searching until xxx Milliseconds have passed</p>
  
  <p>I have 1 idea in mind, would there be an easy way to convert FutureBuilder to Stream and Use Stream builder, (which I read in some articles that it supports debouncing)?</p>
  
  <p>**I am aware that there are some 3rd party AutoComplete widgets like <code>TypeAhead</code> that's doing that (from scratch) but I don't wanna use this at the moment.</p>