title: How to search for items in an already generated ListView.builder with Getx
body: <p>At the moment, I am displaying a list of items received by the query and the database. How can I use the search bar to rebuild ListView.builder. I only use StatelessWidget since I'm trying to learn the getX package. How will my SearchBar link to the list of items?</p>
  <p>Given that in the Search bar I need to join the onChanged property</p>
  <p>P.S: I'm sorry for my English, it's terrible)</p>
  <p><strong>My builder code:</strong></p>
  <pre><code>Widget build(BuildContext context) {
      return GetX&lt;ProductController&gt;(
        init: ProductController(),
        builder: (controller) {
          return FutureBuilder&lt;List&lt;ProductsCombined&gt;&gt;(
            future: controller.productList.value,
            builder: (context, snapshot) {
              if (snapshot.hasData) {
                return ListView.builder(
                  physics: NeverScrollableScrollPhysics(),
                  itemCount: snapshot.data.length,
                  shrinkWrap: true,
                  itemBuilder: (BuildContext context, int index) =&gt;
                      ProductCards(
                    index: index,
                    snapshot: snapshot,
                  ),
                );
              } else {
                return Center(child: CircularProgressIndicator());
              }
            },
          );
        },
      );
    }
  </code></pre>
  <p><strong>My controller code:</strong></p>
  <pre><code>class ProductController extends GetxController {
    final productList = Future.value(&lt;ProductsCombined&gt;[]).obs;
  
    @override
    void onInit() {
      fetchProducts();
      super.onInit();
    }
  
    Future&lt;List&lt;ProductsCombined&gt;&gt; callDb() async {
      return await DBHelper.db.getProducts();
    }
  
    void fetchProducts() async {
      productList.value = callDb();
    }
  }
  </code></pre>
  <p><strong>EDIT:
  I tried to do this, but without success</strong></p>
  <p>Changed the controller code:</p>
  <pre><code>class ProductController extends GetxController {
    final productList = Future.value(&lt;ProductsCombined&gt;[]).obs;
    Rx&lt;Future &lt;List&lt;ProductsCombined&gt;&gt;&gt; filterProduct = Future.value(&lt;ProductsCombined&gt;[]).obs;//Переписать productList в копию и везде указывать уже копию
  
    Future&lt;void&gt; searchChanged(String value) async{
      if(value != null &amp;&amp; value.isNotEmpty){
         List&lt;ProductsCombined&gt; s = await productList.value;
        filterProduct = Future.value(s.where((element) =&gt; (element.productName.toLowerCase().contains(value.toLowerCase()))).toList()).obs;
      }
      filterProduct = productList;
    }
  
  
    @override
    void onInit() {
      fetchProducts();
      filterProduct = productList;
      super.onInit();
    }
  
    Future&lt;List&lt;ProductsCombined&gt;&gt; callDb() async {
      return await DBHelper.db.getProducts();
    }
  
    void fetchProducts() async {
      productList.value = callDb();
    }
  }
  </code></pre>
  <p>Calling a method in TextField:</p>
  <pre><code>TextField(
          onChanged: (string) {
            controller.searchChanged(string);
          }
  </code></pre>
  <p>Also in FutureBuilder, I changed the controller.ProductList.value on the controller.filterProduct.value</p>