title: Flutter - TextField auto complete suggestions from SQLite
body: <p>I am trying to create an autocomplete <code>TextField</code>. This one is working when I used the below hardcoded <code>List</code>.</p>
  <pre><code>List&lt;String&gt; suggestions = [
      &quot;Apple&quot;, 
      &quot;Actual&quot;,
      &quot;Actuary&quot;,
      &quot;America&quot;,
      &quot;Argentina&quot;,
    ];
  </code></pre>
  <p>But when I used to get data from SQLite and filter it's not filtering. Not working. The SQLite list also getting the same format as the above one. But it's not calling to <code>itemFilter</code> part. Please help. I am new to flutter.</p>
  <pre><code>static Future&lt;List&lt;String&gt;&gt; selectItems() async {
  var db = await _openDB();
  final usersData = await db.query(&quot;albums&quot;);
  return usersData.map((Map&lt;String, dynamic&gt; row) {
    return row[&quot;albumname&quot;] as String;
  }).toList();}
  
  
    List&lt;String&gt; itemsList;
  
    void selectItems() async {
      itemsList =  await DBManager.selectItems();
    }
  </code></pre>
  <p>This is text filed Code</p>
  <pre><code>  Container(
                width: _width * 2,
                height: 50,
                padding: const EdgeInsets.symmetric(horizontal: 10),
                child: AutoCompleteTextField(
                  controller: txtAlbumSuggest,
                  suggestions: itemsList,
                  clearOnSubmit: false,
                  style: TextStyle(color: Colors.black,fontSize: 15),
                  decoration: InputDecoration(
                      border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(20.5)
                      )
                  ),
                 itemFilter: (item,query){
                 return item.toLowerCase().startsWith(query.toLowerCase());
                 },
                  itemSorter: (a,b){
                    return a.compareTo(b);
                  },
                  itemSubmitted: (item){
                    txtAlbumSuggest.text=item;
                  },
                  itemBuilder: (context,item){
                    return Container(
                        padding: EdgeInsets.all(20.0),
                      child: Row(
                        children: &lt;Widget&gt;[
                          Text(
                            item,
                            style: TextStyle(color: Colors.black),
                          )
                        ],
                      ),
  
                    );
  
                  },
                ), 
              ),
  </code></pre>