title: Flutter: Listview is not updating upon search
body: <p>Everything is working fine, but ListView is not updating on onChanged. Although I am using setstate, but it is still not filtering the data. Note(The List is being filtered as I have printed it. The only problem is with the screen as it is not updating)</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:provider/provider.dart';
  import 'package:travel_together_passenger/Models/user.dart';
  import 'package:travel_together_passenger/Screens/User_Available_Carpools_TILE.dart';
  
  class User_AvailableCarpools_LIST extends StatefulWidget {
  
    @override
    _User_AvailableCarpools_LISTState createState() =&gt;
        _User_AvailableCarpools_LISTState();
  }
  
  class _User_AvailableCarpools_LISTState
      extends State&lt;User_AvailableCarpools_LIST&gt; {
    @override
    Widget build(BuildContext context) {
      final checkcarpools = Provider.of&lt;List&lt;CarpoolDataShow&gt;&gt;(context) ?? [];
      final availablecarpools =
          checkcarpools.where((element) =&gt; element.seats &gt; 0).toList() ?? [];
      List filteredcarpools =
          checkcarpools.where((element) =&gt; element.seats &gt; 0 ).toList() ?? [];
      return Scaffold(
        body: Column(
          children: [
            Expanded(
                child: TextField(
              decoration: InputDecoration(hintText: 'Search..'),
              onChanged: (text) {
                setState(() {
                  filteredcarpools = availablecarpools
                      .where((element) =&gt; element.pickupaddress
                          .toLowerCase()
                          .contains(text.toLowerCase()))
                      .toList();
                });
              },
            )),
            Expanded(
              flex: 10,
              child: ListView.builder(
                itemCount: filteredcarpools.length,
                itemBuilder: (context, index) {
                  return User_AvailableCarpools_TILE(filteredcarpools[index]);
                },
              ),
            ),
          ],
        ),
      );
    }
  }
  
  </code></pre>