refactor(ui): early return Offstage in case index is null.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-08-17 16:17:19 +05:30
committed by xsahil03x
parent 56bd3b5b50
commit b2eb51317f
@@ -674,10 +674,9 @@ class _MessageListViewState extends State<MessageListView> {
index = _getBottomElementIndex(values);
}
if (index == null || index <= 2 || index >= itemCount - 3) {
if (index == null) {
return const Offstage();
}
if (index == null) return const Offstage();
if (index <= 2 || index >= itemCount - 3) {
if (widget.reverse) {
index = itemCount - 4;
} else {