collection: scroll to top on filter change
This commit is contained in:
parent
4d8e2d4123
commit
c840190aec
1 changed files with 4 additions and 0 deletions
|
@ -195,10 +195,12 @@ class _CollectionScrollViewState extends State<CollectionScrollView> {
|
|||
}
|
||||
|
||||
void _registerWidget(CollectionScrollView widget) {
|
||||
widget.collection.filterChangeNotifier.addListener(_onFilterChange);
|
||||
widget.scrollController.addListener(_onScrollChange);
|
||||
}
|
||||
|
||||
void _unregisterWidget(CollectionScrollView widget) {
|
||||
widget.collection.filterChangeNotifier.removeListener(_onFilterChange);
|
||||
widget.scrollController.removeListener(_onScrollChange);
|
||||
}
|
||||
|
||||
|
@ -281,6 +283,8 @@ class _CollectionScrollViewState extends State<CollectionScrollView> {
|
|||
);
|
||||
}
|
||||
|
||||
void _onFilterChange() => widget.scrollController.jumpTo(0);
|
||||
|
||||
void _onScrollChange() {
|
||||
widget.isScrollingNotifier.value = true;
|
||||
_stopScrollMonitoringTimer();
|
||||
|
|
Loading…
Reference in a new issue