Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter ScrollController finout max offset

Tags:

flutter

dart

I would like to make some kind of custom scroll progress indicator for CustomScrollView.

_scrollController = ScrollController()..addListener(_scroll);

void _scroll() {
    print('scrolled ${_scrollController.offset} from {??}');
}

Is there way to findout _scrollController max offset?

Or could I get some value form Scrollbar widget?

like image 905
Ilya Avatar asked Apr 15 '26 02:04

Ilya


1 Answers

So all you need is

scrollController.position.maxScrollExtent

This gives you the max scroll extent for the ListView


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!