title: Flutter Search Delegate filter data with first charater capitalised
body: <p>As it can be seen from the code snippet attached below the list I am filtering data on has elements which start with a capital letter. Now when I open the delegate, by default the keyboard opens up without default caps lock (In other words user inputs small characters). I want to filter data whether the user starts with a uppercase letter or small case. I've tried basic conditions, e.g., query interpolation by making the first character uppercase using if else check but I am unable to get the desired result.
  Can someone please tell me the correct approach to do this.</p>
  <pre><code>    // I've tried query = query[0].toUpperCase() + query.substring(1) while handling the edge case but this doesn't work
      final suggestions = query.isEmpty
          ? cities
          : cities
              .where((element) =&gt;
                  element.contains(query) &amp;&amp; element.startsWith(query))
              .toList();
  </code></pre>
  <p>Full Code:</p>
  <pre><code>class DataSearch extends SearchDelegate&lt;String&gt; {
    final cities = [
      &quot;Agra&quot;,
      &quot;Ahmedabad&quot;,
      &quot;Amsterdam&quot;,
      &quot;Antalya&quot;,
      ....
    ];
  
    @override
    List&lt;Widget&gt; buildActions(BuildContext context) {
      return [
        IconButton(
          icon: Icon(Icons.clear),
          onPressed: () {
            query = &quot;&quot;;
          },
        )
      ];
    }
  
    @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 Container();
    }
  
    @override
    Widget buildSuggestions(BuildContext context) {
  
      final suggestions = query.isEmpty
          ? cities
          : cities
              .where((element) =&gt;
                  element.contains(query) &amp;&amp; element.startsWith(query))
              .toList();
  
      return ListView.builder(
        itemBuilder: (context, index) =&gt; ListTile(
          onTap: () {
            close(context, suggestions[index]);
          },
          leading: Icon(Icons.location_city),
          title: RichText(
            text: TextSpan(
                text: suggestions[index].substring(0, query.length),
                style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.bold,
                    fontSize: 17),
                children: [
                  TextSpan(
                      text: suggestions[index].substring(query.length),
                      style: TextStyle(color: Colors.grey))
                ]),
          ),
        ),
        itemCount: suggestions.length,
      );
    }
  }
  </code></pre>