Flutter-Friends
Flutter-Friends copied to clipboard
Flutter - Why listview is going infinite
Not sure since I have just started building things with Flutter and Dart. If anyone can take a look at the code and can share inputs on:
- How to display listview having fixed number of items, lets say in my example we are fetching 100 items
- How to implement paging, lets say initially I want to fetch 1st page and then while scrolling page 2nd and so on.
Issue: In current implementation, I am finding 2 issues:
- Able to scroll endlessly at bottom
- Finding exception in logcat output:
03-15 06:14:36.464 3938-3968/com.technotalkative.flutterfriends I/flutter: Another exception was thrown: RangeError (index): Invalid value: Not in range 0..99, inclusive: 100
Screenshot:

you can use pagination using pagewise https://pub.dev/packages/flutter_pagewise
I have solved the issue with Infinite Scrolling Lists, sent a PR.... have a look