-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to Reproduce
listener UserScrollNotification,and print direction.
when i fling,i get
log is:
I/flutter ( 5729): update scroll direction ScrollDirection.idle
I/flutter ( 5729): update scroll direction ScrollDirection.reverse
I/flutter ( 5729): update scroll direction ScrollDirection.idle
in this case ,when i begin drage,i get first update state is idle
or
I/flutter ( 5729): update scroll direction ScrollDirection.forward
in this case, when i drage end,i not get idle
Expected results:
when i begin drage,i can get update state is reverse or forward
when NestedScrollView scroll end,i can get update state is idle
Actual results:
I/flutter ( 5729): update scroll direction ScrollDirection.idle
I/flutter ( 5729): update scroll direction ScrollDirection.reverse
I/flutter ( 5729): update scroll direction ScrollDirection.idle
or
I/flutter ( 5729): update scroll direction ScrollDirection.forward
Code sample
NotificationListener<UserScrollNotification>(
onNotification: (notification) {
print(' update scroll direction ScrollDirection.${notification.direction.toString()}');
return true;
},
child: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
title: const Text('ListView'),
pinned: true,
forceElevated: innerBoxIsScrolled,
),
];
},
body: ListView.builder(
padding: const EdgeInsets.all(8),
physics: const ClampingScrollPhysics(),
itemCount: 30,
itemBuilder: (BuildContext context, int index) {
return SizedBox(
height: 50,
child: Center(child: Text('Item $index')),
);
},
),
),
)
),Logs