For example, I have SingleChildScrollView with BouncingScrollPhysics.
I want something like print(_overscrollOffsetValue) when content jumps from edge, e.g. the more offset value of overscroll, the bigger _overscrollOffsetValue.
For example, I have SingleChildScrollView with BouncingScrollPhysics.
I want something like print(_overscrollOffsetValue) when content jumps from edge, e.g. the more offset value of overscroll, the bigger _overscrollOffsetValue.
You can listen for ScrollUpdateNotification:
NotificationListener<ScrollNotification>(
onNotification: (notification) {
if (notification is ScrollUpdateNotification) {
final offset = notification.metrics.pixels;
if (offset < 0) {
print(offset.abs());
}
}
return false;
},
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Text('A' * 10000),
),
)