title: Prevent ListView.Builder rebuild for a particular ListItem Change in FutureBuilder
body: <p>I am querying data from sqflite database and using a futurebuilder for the purpose of showing a refreshing icon. Once the data is retrieved through snapshot.connectionState == ConnectionState.done, I am calling a ListView.builder method to show the data. I also have an icon in each of the list item that is displayed. Upon click on the item, I am toggling a column value in the database. As I also need to toggle the icon in the ui upon each click. For this, after updating the database, I am calling setstate. This toggles the icon in the ui but because of setstate, the entire list of items is getting rebuilt. How can I avoid this?I only want the icon of that particular listitem to change. Is Provider the recommended way to go to achieve this?</p>
  <pre><code>  class _HomeState extends State&lt;Home&gt; {
    final _dbHelper = DatabaseHelper.instance;
    
    
      Future&lt;int&gt; _toggleFavourite(int id, int value) async {
      return await _dbHelper.updateFavourite(id, value);- //toogles the column value in db
    }
    
    
     @override
    Widget build(BuildContext context) {
      return Scaffold(
     body: FutureBuilder(
                future: _dbHelper.queryAllRows(),//Get all rows from db
                builder: (context, snapshot) {
                  if (snapshot.connectionState == ConnectionState.done) {
                    final _allRows = snapshot.data as List&lt;Map&lt;String, dynamic&gt;&gt;;
                    _codes.clear();
                    _allRows.forEach((row) =&gt; _codes.add(Code.fromMap(row)));
                    
                     return SafeArea(
                      child: Column(
                        children: [
                          Expanded(
                            child:ListView.builder(
                                    padding: const EdgeInsets.all(8),
                                    itemCount: _codes.length,
                                    itemBuilder:
                                        (BuildContext context, int index) {
                                      return InkWell(
                                          onTap: () {
                                                                                   },
                                          child: Card(
                                           
                                              child: ListTile(
                                             
                                                title: Text(
                                                  _codes[index].code,
                                                  maxLines: 1,
                                                  overflow: TextOverflow.ellipsis,
                                                  softWrap: false,
                                                ),
                                              trailing: SizedBox(
                                                  width: 100,
                                                  child: Row(
                                                    children: [
                                                      IconButton(
                                                          onPressed: () {
                                                            _toggleFavourite(
                                                                    _codes[index]
                                                                        .id,
                                                                    _codes[index]
                                                                                .favourite ==
                                                                            1
                                                                        ? 0
                                                                        : 1)
                                                                .then(
                                                                    (affectedRows) {
                                                              if (affectedRows &gt;
                                                                  0) {
                                                                setState(() {});//Rebuilds all the listitems :(
                                                              }
                                                              
                                                            });
                                                          },
                                                          icon: Icon(
                                                            _codes[index]
                                                                        .favourite ==
                                                                    1
                                                                ? Icons.favorite
                                                                : Icons
                                                                    .favorite_border_outlined,
                                                            size: 35,
                                                          )),
                                                          
                                                          .........
                                                      
                                                      
                                                      
  </code></pre>