title: Flutter Visibility with Condition (How can I hide only one widget with condition)
body: <p>I have a problem with using Visibility widget.</p>
  <p>What I want to do is hiding certain listview's by depending user's click on my Row. But when User click on row, all Listview is showing. When clicked again, all listview widget's are going away.</p>
  <p>What I want to do is with images:<br>
  <a href="https://i.stack.imgur.com/qj6oB.png" rel="nofollow noreferrer">This is how my page looks</a><br>
  <a href="https://i.stack.imgur.com/CZjI8.png" rel="nofollow noreferrer">This is what happens when I click on arrow button or &quot;Sezon 1&quot; Text</a><br>
  <a href="https://i.stack.imgur.com/tWXkf.png" rel="nofollow noreferrer">This is what I want to do when I click on arrow button or &quot;Sezon 1&quot; Text</a><br></p>
  <p>What I'm trying to do is When I click Season 2, it will show season 2 episodes. When I click season 3 it will show season 3 episodes etc.</p>
  <p>Here is my code (I know It's a little messy for right now, apologize for that) :
  GestureDetector is working same for every click.</p>
  <pre><code>bool viewVisible = false;
  void hideWidget() {
  setState(() {
    viewVisible = !viewVisible;
    print(viewVisible);
  });
  
  StreamBuilder&lt;QuerySnapshot&gt;(
                  stream: seasons.snapshots(),
                  builder:
                      (BuildContext context, AsyncSnapshot asyncSnapshot) {
                    if (asyncSnapshot.hasError) {
                      return Center(
                          child:
                              Text('Error'));
                    } else {
                      if (asyncSnapshot.hasData) {
                        List&lt;DocumentSnapshot&gt; listOfDocumentSnap =
                            asyncSnapshot.data.docs;
  
                        return Padding(
                          padding: const EdgeInsets.only(top: 0, left: 0),
                          child: Align(
                            alignment: Alignment.topLeft,
                            child: Column(
                              children: [
                                ListView.builder(
                                  shrinkWrap: true,
                                  itemCount: listOfDocumentSnap.length,
                                  itemBuilder: (context, index) {
                                    var episodes = firestore
                                        .collection('shows')
                                        .doc(data.id)
                                        .collection('Seasons')
                                        .doc(listOfDocumentSnap[index].id)
                                        .collection('Episodes');
  
                                    return Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      mainAxisAlignment:
                                          MainAxisAlignment.start,
                                      children: [
                                        Padding(
                                          padding: const EdgeInsets.only(
                                              top: 0, left: 18, right: 18),
                                          child: GestureDetector(
                                            onTap: () {
                                              hideWidget();
                                            },
                                            child: Container(
                                              decoration: BoxDecoration(
                                                  borderRadius:
                                                      BorderRadius.circular(
                                                          8),
                                                  border: Border.all(
                                                      color: Colors.pink)),
                                              child: Row(
                                                children: [
                                                  SizedBox(
                                                    width: 20,
                                                  ),
                                                  Text(
                                                    listOfDocumentSnap[index]
                                                        .get('name')
                                                        .toString()
                                                        .toUpperCase(),
                                                    style: TextStyle(
                                                        fontSize: 20,
                                                        color:
                                                            Colors.grey[800],
                                                        fontWeight:
                                                            FontWeight.w700),
                                                  ),
                                                  Spacer(flex: 1),
                                                  Icon(
                                                    Icons.arrow_drop_down,
                                                    size: 45,
                                                    color: Colors.pink,
                                                  ),
                                                ],
                                              ),
                                            ),
                                          ),
                                        ),
                                        StreamBuilder&lt;QuerySnapshot&gt;(
                                          stream: episodes.snapshots(),
                                          builder: (BuildContext context,
                                              AsyncSnapshot asyncSnapshot) {
                                            if (asyncSnapshot.hasError) {
                                              return Center(
                                                  child: Text(
                                                      'Error'));
                                            } else {
                                              if (asyncSnapshot.hasData) {
                                                List&lt;DocumentSnapshot&gt;
                                                    listOfDocumentSnap =
                                                    asyncSnapshot.data.docs;
  
                                                return Padding(
                                                  padding:
                                                      const EdgeInsets.only(
                                                          top: 5, left: 18.0),
                                                  child: Visibility(
                                                    visible: viewVisible,
                                                    child: Align(
                                                      alignment:
                                                          Alignment.topLeft,
                                                      child: Column(
                                                        children: [
                                                          ListView.builder(
                                                            shrinkWrap: true,
                                                            itemCount:
                                                                listOfDocumentSnap
                                                                    .length,
                                                            itemBuilder:
                                                                (context,
                                                                    index) {
                                                              return ListTile(
                                                                onTap: () {
                                                                  setState(
                                                                      () {
                                                                    selectedIndex =
                                                                        index;
                                                                  });
                                                                },
                                                                trailing:
                                                                    Icon(Icons
                                                                        .play_arrow),
                                                                title: Text(listOfDocumentSnap[
                                                                        index]
                                                                    .id
                                                                    .toString()),
                                                              );
  
                                                              /*   return Text(
                                                                  listOfDocumentSnap[
                                                                          index]
                                                                      .get(
                                                                          'name'));*/
                                                            },
                                                          ),
                                                        ],
                                                      ),
                                                    ),
                                                  ),
                                                );
                                              } else {
                                                return Center(
                                                    child:
                                                        CircularProgressIndicator());
                                              }
                                            }
                                          },
                                        ),
                                        SizedBox(
                                          height: 30,
                                        )
                                      ],
                                    );
                                  },
                                ),
                              ],
                            ),
                          ),
                        );
                      } else {
                        return Center(child: CircularProgressIndicator());
                      }
                    }
                  },
                ),
  </code></pre>