モハマド:
私はlistView.Builderを持っており、ユーザが画面上で、彼/彼女の指を離すとscrollControllerの位置に基づいて、特定の計算をしたいですか?
演算部は、フラッタに簡単ですが、ユーザーが何らかのアクションを行うには、スクロールから指を離すとどのように私は気づくことができますか?
ハメドHamedi:
使用のNotificationListenerウィジェット。ここではそれについての短いクリップがあります。
あなたが望むことのコードは次のようになります。
@override
Widget build(BuildContext context) {
return NotificationListener<ScrollNotification>(
onNotification: (notification) {
if (notification is ScrollStartNotification) {
debugPrint('Started');
}
if (notification is ScrollUpdateNotification) {
debugPrint('Updated');
}
if (notification is ScrollEndNotification) {
debugPrint('Ended');
}
return false;
},
child: YourListView(),
);
}