diff --git a/lib/grouped_list.dart b/lib/grouped_list.dart index 354dad6..f09f342 100644 --- a/lib/grouped_list.dart +++ b/lib/grouped_list.dart @@ -378,6 +378,10 @@ class _GroupedListViewState extends State> { /// 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 ??=