Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perfect #1

Closed
ghost opened this issue Jun 27, 2018 · 2 comments
Closed

Perfect #1

ghost opened this issue Jun 27, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 27, 2018

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.

@marica27
Copy link
Collaborator

marica27 commented Jul 4, 2018

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");
      }

@ghost
Copy link
Author

ghost commented Jul 7, 2018

thanks @marica27 for the example code. It works well :)
Will close this...

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant