Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to show list more than 0 up of string in array flutter

I have a array here and I want to show all of it accepted for the first one as discibe in an image: enter image description here
And this is the code:

                  StreamBuilder(
                    stream: FirebaseFirestore.instance
                        .collection("groups")
                        .doc(groupId)
                        .snapshots(),
                    builder:(context, AsyncSnapshot<DocumentSnapshot> snapshot) {
                      var userDocument = snapshot.data?["members"];

                                                                 return  ListView.builder(
                                                                              scrollDirection: Axis.horizontal,
                                                                              physics:const BouncingScrollPhysics(),
                                                                              itemCount: userDocument.length,
                                                                              shrinkWrap:true,
                                                                              itemBuilder:(context, index) {
                                                                      //Where I display all my list of members                                                         
                                                                 return Text(userDocument[index]);
                                       }), 

This is what it’s look like in simulator
enter image description here
But it still displays all of it And I dont want to display the first one

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try the following code:

ListView.builder(
  itemCount: userDocument.length,
  itemBuilder: (BuildContext context, int index) {
    return index == 0 ? Container() : write your code here;
  },
),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading