title: setstate futurebuilder flutter
body: <p>Solved!</p>
  <p>I am getting date from FireBase via a futurebuilder.</p>
  <p>It returns a Row whose children is a list of a widget i created called SmallDogCard (since my app is about dogs).</p>
  <p>On a screen i want users to be able to press on the SmallDogCard to select it and change the border color, howerver. This causes the futurebuilder to load the data again... How should i approach this?</p>
  <p>My code:</p>
  <p>Futurebuilder:</p>
  <pre><code>FutureBuilder(
                                  future: DogOwnerModel().getUserData(),
                                  builder: (context, snapshot) {
                                    if (snapshot.hasError) {
                                      return Text('error');
                                    }
                                    if (snapshot.connectionState ==
                                        ConnectionState.done) {
                                      List&lt;SmallDogCard&gt; dogCardList = [];
                                      final userData =
                                          snapshot.data as Map&lt;String, dynamic&gt;;
  
                                      List&lt;Map&lt;String, dynamic&gt;&gt;? userDogs =
                                          userData['user dog data'];
                                      if (userDogs == null) {
                                        return Text('no dogs yet');
                                      } else {
                                        for (Map&lt;String, dynamic&gt; dog
                                            in userDogs) {
                                          dogCardList.add(SmallDogCard(
                                              dogName: dog['name'],
                                              imageUrl: dog['profile image'],
                                              isSelected: selectedDogs
                                                      .contains(dog['name'])
                                                  ? true
                                                  : false,
                                              selectCallback: selectDogCallback));
                                        }
                                        return Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.start,
                                            children: dogCardList);
                                      }
                                    }
                                    return Text('Loading');
                                  },
                                ),
  </code></pre>
  <p>Onpress function callback passed to the SmallDogCard (which uses setstate and makes the futurbuilder get the data again).</p>
  <pre><code>selectDogCallback(String name, bool isSelected) {
      if (isSelected == false) {
        selectedDogs.add(name);
      } else {
        selectedDogs.remove(name);
      }
      setState(() {
        selectedDogs;
      });
    }
  </code></pre>
  <p>How can i accomplish this without the futurebuilder being called again?
  So i can setstate which changes the border color of the SmallDogCard which is returned from the FutureBuilder.</p>
  <p>Thank you in advance!</p>