Skip to content

Commit

Permalink
[bugfix] fix RangeError when _sortedElements is empty (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
magazmj committed Apr 9, 2023
1 parent 94a0467 commit 846d83b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/grouped_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ class _GroupedListViewState<T, E> extends State<GroupedListView<T, E>> {
/// is not required since the group headers are displayed inside the lists and
/// do not need to be always in the visible frame.
void _scrollListener() {
if (_sortedElements.isEmpty) {
return;
}

_listBox ??= _key.currentContext?.findRenderObject() as RenderBox?;
var listPos = _listBox?.localToGlobal(Offset.zero).dy ?? 0;
_headerBox ??=
Expand Down

0 comments on commit 846d83b

Please sign in to comment.