πŸš€ 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 begin displaying the list entries starting at index 5.

I want to begin displaying the list entries starting at index 5.
view raw gistfile1.txt hosted with ❀ by GitHub

Check out this

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

You can try it even though I’m not sure whether this is what you are looking for. Use the β€œVisibility” widget as the example below to limit the display of particular objects based on specified criteria.

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

Perhaps you are looking for this.

ListView.builder(
itemCount: items.length - 5,
itemBuilder: (context, index) {
return ListTile(
title: Text(items[index+5].toString()),
);
},
);
view raw gistfile1.txt hosted with ❀ by GitHub
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