Flutter filter data with pagination issue

Viewed 259

In my flutter project,I load the pagination list of 50 product.In that listview i want to offline search with text editing controller and filter whole list in offline mode.

I used infinite_scroll_pagination dependency for pagination listview.

I have the logic of offline search:

 _onProductSearchChanged() {
    if (cartSearchQueryController.text.isNotEmpty) {
      if (cartSearchQueryController.text.length > 0) {
        filteredCartSalesMarketingDetail = cartSalesMarketingDetail
            .where(
              (u) => (u.marketingName.toLowerCase().contains(
                    cartSearchQueryController.text.toLowerCase(),
                  )),
            )
            .toList();
      }
    } else {
      filteredCartSalesMarketingDetail = cartSalesMarketingDetail;
    }
}

It will work in normal listview but not work in infinite_scroll_pagination.

Here i have attach the screenshot of product list.

enter image description here

Anyone Help?

0 Answers
Related