title: Searchable Dropdown with Flutter, Mobx and Sqlite
body: <p>I am tryng implement a Searchable Dropdown package:</p>
  <p><a href="https://github.com/salim-lachdhaf/searchable_dropdown" rel="nofollow noreferrer">https://github.com/salim-lachdhaf/searchable_dropdown</a></p>
  <p>I am using mobx and Sqlite</p>
  <p>See Widget Code:</p>
  <pre><code>DropdownSearch&lt;TarefaModel&gt;(
                              
                              label: 'BUSCAR TAREFAS',
                              onFind: (String filter) =&gt;
                                  controller.filtrarTarefas(filter),
                              onChanged: (TarefaModel data) {
                                print(data);
                              },
                              dropdownBuilder: _customDropDownExample,
  
                            ),
  
  </code></pre>
  <p>My Mobx action:</p>
  <p>Controller action:</p>
  <pre><code>
    @observable
    ObservableList&lt;TarefaModel&gt; tarefas = new ObservableList&lt;TarefaModel&gt;();
  
    @action
    filtrarTarefas(termo) async {
  
      final repository = new TarefaRepository();
      tarefas = new ObservableList&lt;TarefaModel&gt;();
      var data = await repository.search(termo);
      tarefas.addAll(data);
      return tarefas;
    }
  
  
  </code></pre>
  <p>Custom DropDown:</p>
  <pre><code>Widget _customDropDownExample(
        BuildContext context, TarefaModel item, String itemDesignation) {
      return Container(
        child: Observer(
            builder: (_) =&gt; ListView.builder(
                itemCount: controller.tarefas.length,
                itemBuilder: (context, i) {
                  return ListTile(
                    title: Text(item.descricao),
                    subtitle: Text(item.label),
                  );
                })),
      );
    }
  
  </code></pre>
  <p>My Model:</p>
  <pre><code>class TarefaModel{
  
    int id;
    String descricao;
    TarefaModel({this.id, this.descricao});
   
    Map&lt;String, dynamic&gt; toMap() {
      return {'id': id,'descricao': descricao};
  
    }
  
  }
  </code></pre>
  <p>But this erros is show:</p>
  <p><a href="https://i.stack.imgur.com/D6CUV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D6CUV.png" alt="enter image description here" /></a></p>
  <p>Any idea? Thanks</p>