Closed ghost closed 6 years ago
Thanks, @gedw99.
Yes, scrollbar and list view are coupled in some way. You need to provide labelTextBuilder. You can do it like this. You need to know heights of rows in your list view.
labelTextBuilder: (offset) {
final int currentItem = offset ~/ _heightOfRowInListView;
var letter = _data[currentItem].name.substring(0,1);
return Text("$letter");
}
thanks @marica27 for the example code. It works well :) Will close this...
This is awesome.
I have a request. You know how in a contracts app where you have a draggable scrollbar and it shows the first letter of the area you up to. For example as I drag scroll from N to O in the list it shows an O near the scroll bar ( or maybe in the top right of the screen ).
Not sure how to do it because it means the scroll batmr needs to be sent a signal from the list view as it goes from N to O. So it's coupled.