I have a ListView
which normally starts at the top and can be scrolled down, but I have reverse
set to true
which is what I need it to be, but now the list starts from the bottom.
How can I set the start position so it starts at the top and scrolls down despite being reversed?
So basically it's like this, with the date order reversed like I need:
14th
12th
7th
6th
5th
But the whole thing is scrolled to the bottom by default...so I can't see 12th and 14th unless I scroll up.
....off the top of the screen
7th
6th
5th
4th
3rd - starting position.
I need it to start from the scrolled to the top by setting the scroll start position. I hope this description makes it a bit clearer.
You can reverse the order of presentation in this manner as well: Note the ((feed.length-1) - index)
array index. Using some combination of this technique and what you are using will result in what you desire.
List<String> feed = List();
feed.add("AAAA");
feed.add("BBBB");
feed.add("CCCC");
ListView.builder(
itemCount: feed.length,
itemBuilder: (context, index) {
return ListTile(title: feed[(feed.length - 1) - index]);
},
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With