Max*_*yba 5 flutter flutter-layout
例如,我有SingleChildScrollView
与BouncingScrollPhysics
. 我想要类似print(_overscrollOffsetValue)
内容从边缘跳转时的内容,例如过度滚动的偏移值越大,_overscrollOffsetValue
.
您可以监听 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),
),
)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1179 次 |
最近记录: |