flutter_infinite_listview icon indicating copy to clipboard operation
flutter_infinite_listview copied to clipboard

How to remove the white space when the list reach out to the last item

Open sopherwang opened this issue 4 years ago • 4 comments

Problem: there is a large white space when the listview reaches out to the last item.

Would be great if anyone can help me to remove the white spaces.

Attached a video:

https://user-images.githubusercontent.com/4219513/124019021-6145f680-d99d-11eb-86fd-db8e4deb26d8.mp4

sopherwang avatar Jun 30 '21 19:06 sopherwang

@sopherwang Good evening ! did you manage to fix it?

olegys avatar Oct 22 '21 19:10 olegys

+1

@slightfoot @bernaferrari @jeroen-meijer

mbfakourii avatar Oct 01 '22 18:10 mbfakourii

You can fix this by scrollable_positioned_list

import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
const negativeItemCount = 20;
const itemCount = 40;
return ScrollablePositionedList.builder(
  itemCount: itemCount + negativeItemCount,
  initialScrollIndex: negativeItemCount,
  reverse: true,
  itemBuilder: (context, i) {
    i -= negativeItemCount;
    return ListTile(title: Text(i.toString()));
  },
);

It is also possible to create a pseudo infinite scroll by specifying a very large number

fa0311 avatar Jan 26 '23 00:01 fa0311