marcglasberg / indexed_list_view

Flutter package: Similar to a ListView, but lets you programmatically jump to any item, by index.
BSD 2-Clause "Simplified" License
251 stars 21 forks source link

Stopping infinite scroll #24

Closed pbertsch closed 4 years ago

pbertsch commented 4 years ago

Is there a way to stop the infinite scroll. Right now I have 5 Items in my list and I want the scroll to stop when it reaches item 0 or item 4 in the list.

I tried the maxItemCount=5 but it seems ignored, the scroll keeps on going either way. I am using Flutter Web at the moment.

[✓] Flutter (Channel beta, 1.19.0-4.1.pre, on Mac OS X 10.15.5 19F101, locale en-MX) • Flutter version 1.19.0-4.1.pre at /Users/patrickbertsch/dev/flutter • Framework revision f994b76974 (2 weeks ago), 2020-06-09 15:53:13 -0700 • Engine revision 9a28c3bcf4 • Dart version 2.9.0 (build 2.9.0-14.1.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0) • Android SDK at /Users/patrickbertsch/Library/Android/sdk • Platform android-30, build-tools 30.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.9.0

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 46.0.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.46.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.11.0

marcglasberg commented 4 years ago

No, sorry, this is an infinite list only. You need a different widget.

marcglasberg commented 4 years ago

For finite, try this: https://pub.dev/packages/scrollable_positioned_list