title: Why AutoCompleteTextField is not showing any suggestion in Flutter?
body: <p>I am new to Flutter and currently working on a project where I need to show user a list of matched members so that a user can easily select one of them. For that I use AutoCompleteTextField. It is working fine as long as provided by already fetched list of members to it's suggestion property. But I wonder, why it's not working when I put it under BlocBuilder. Event hits on textChanged method and the state also returns a list but the suggestions are invisible.</p>
  <pre><code>  Widget autoCompleteSearchBar() {
      return BlocBuilder&lt;OrderInfoBloc, MyOrderInfoStates&gt;(
        builder: (context, state) {
            return AutoCompleteTextField&lt;Member&gt;(
              clearOnSubmit: false,
              style: TextStyle(
                color: Colors.black,
                fontSize: 16,
              ),
              decoration: InputDecoration(
                hintText: 'Search Member Here..',
                border: InputBorder.none,
                suffixIcon: IconButton(
                  icon: Icon(Icons.cancel),
                  iconSize: 20,
                  color: Colors.yellow[700],
                  onPressed: () {
                    _autoCompleteController.text = &quot;&quot;;
                  },
                ),
                contentPadding: EdgeInsets.fromLTRB(10, 30, 10, 20),
                hintStyle: TextStyle(color: Colors.grey),
              ),
              keyboardType: TextInputType.text,
              controller: _autoCompleteController,
              textChanged: (value) {
                context.read&lt;OrderInfoBloc&gt;().add(SearchTextChanged(text: value));
              },
              itemSubmitted: (item) async {
                _autoCompleteController.text = state.radioGroupValue == 'By Code'
                    ? item.memberNo
                    : item.memberName;
                context.read&lt;OrderInfoBloc&gt;().add(SelectedMember(member: item));
              },
              key: _key,
              suggestions: state.membersList,
              itemBuilder: (context, item) {
                print(item);
                // return state.radioGroupValue == 'By Code'
                //     ? autoCompleteSearchBarRow(
                //         item: item.memberNo, icon: Icon(Icons.person))
                //     : autoCompleteSearchBarRow(
                //         item: item.memberName, icon: Icon(Icons.person));
                return autoCompleteSearchBarRow(
                    item: item.memberNo, icon: Icon(Icons.person));
              },
              itemFilter: (item, query) {
                print(query);
                // bool _itemFilter;
                // if (_autoCompleteController.text.isNotEmpty) {
                //   _itemFilter = state.radioGroupValue == 'By Code'
                //       ? item.memberNo
                //           .toLowerCase()
                //           .startsWith(query.toLowerCase())
                //       : item.memberName
                //           .toLowerCase()
                //           .startsWith(query.toLowerCase());
                // } else {
                //   _autoCompleteController.text = '';
                //   _itemFilter = false;
                // }
                // return _itemFilter;
                return item.memberNo.toLowerCase().startsWith(query.toLowerCase());
              },
              itemSorter: (a, b) {
                // return state.radioGroupValue == 'By Code'
                //     ? a.memberNo.compareTo(b.memberNo.toLowerCase())
                //     : a.memberName.compareTo(b.memberName.toLowerCase());
                print(b);
                return a.memberNo.compareTo(b.memberNo.toLowerCase());
              },
            );
          }
      );
    }
  
    Widget autoCompleteSearchBarRow(
        {@required String item, @required Icon icon}) {
      return ListTile(
        leading: icon,
        title: Text(item),
      );
    }
  </code></pre>