πŸš€ DevOps Certified Professional
πŸ“… Starting: 1st of Every Month 🀝 +91 8409492687 | 🀝 +1 (469) 756-6329 πŸ” Contact@DevOpsSchool.com

How to show items from specific index in a listview builder flutter

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

I want to start showing the list items from index 5

ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return ListTile(
title: Text('${items[index]}'),
);
},
);
view raw gistfile1.txt hosted with ❀ by GitHub

Check this out

ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
if(index < 5) return SizedBox();
return ListTile(
title: Text('${items[index]}'),
);
},
);
view raw gistfile1.txt hosted with ❀ by GitHub
ListView.builder(
      itemCount: items.length,
      itemBuilder: (context, index) {
        return Visibility(
          visible: index>5,
          child: ListTile(
            title: Text('${items[index]}'),
          ),
        );
      },
    );

Maybe this is what you are looking for

ListView.builder(
itemCount: items.length - 5,
itemBuilder: (context, index) {
  return ListTile(
    title: Text(items[index+5].toString()),
  );
},
);
Subscribe
Notify of
guest


This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x