title: Flutter: Autocomplete Textfield not working with custom data type
body: <p>I'm trying to build a text field with autocomplete feature. And I'm using <a href="https://pub.dev/packages/autocomplete_textfield#-" rel="nofollow noreferrer">AutoComplete TextField</a> package. </p>
  
  <p>I have Users model class with <code>fromMap</code> and <code>toMap</code> methods. There's function which retrieves users form database and returns list of users <code>List&lt;Users&gt;</code>. </p>
  
  <p>Here's the code which builds autocomplete field:</p>
  
  <pre><code>AutoCompleteTextField searchTextField = AutoCompleteTextField&lt;Users&gt;(
      key: key,
      clearOnSubmit: false,
      suggestions: users,
      style: TextStyle(color: Colors.black, fontSize: 16.0),
      decoration: InputDecoration(
        contentPadding: EdgeInsets.fromLTRB(10.0, 30.0, 10.0, 20.0),
        hintText: "Search Name",
        hintStyle: TextStyle(color: Colors.black),
      ),
      itemFilter: (item, query) {
        return item.name.toLowerCase().startsWith(query.toLowerCase());
      },
      itemSorter: (a, b) {
        return a.name.compareTo(b.name);
      },
      itemSubmitted: (item) {
        setState(() {
          searchTextField.textField.controller.text = item.name;
        });
      },
      itemBuilder: (context, item) {
        return Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: &lt;Widget&gt;[
            Text(
              item.name,
            ),
          ],
        );
      },
    );
  </code></pre>
  
  <p><strong>Q.</strong> Am I missing something or doing wrong? </p>
  
  <p><strong>NOTE:</strong></p>
  
  <ol>
  <li>The <code>users</code> object have list of users in correct format, I've printed to verify that.</li>
  </ol>