Flutter-Friends icon indicating copy to clipboard operation
Flutter-Friends copied to clipboard

Flutter - Why listview is going infinite

Open PareshMayani opened this issue 7 years ago • 2 comments

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:

  1. Able to scroll endlessly at bottom
  2. 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: screenshot_1521095404

PareshMayani avatar Mar 15 '18 06:03 PareshMayani

you can use pagination using pagewise https://pub.dev/packages/flutter_pagewise

ysavr avatar Jun 27 '19 04:06 ysavr

I have solved the issue with Infinite Scrolling Lists, sent a PR.... have a look

rahul-badgujar avatar Jan 03 '21 18:01 rahul-badgujar