Skip to content

Commit

Permalink
Only remove listener if it was originally added (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimibe committed Nov 20, 2020
1 parent 041ffe7 commit f9e3c2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/grouped_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ class _GroupedListViewState<T, E> extends State<GroupedListView<T, E>> {

@override
void dispose() {
_controller.removeListener(_scrollListener);
if (widget.useStickyGroupSeparators) {
_controller.removeListener(_scrollListener);
}
if (widget.controller == null) {
_controller.dispose();
}
Expand Down

0 comments on commit f9e3c2a

Please sign in to comment.