Skip to content

Commit 2b3c3a9

Browse files
committed
perf: remove uneccesary infinite rebuilds
1 parent 51f3dce commit 2b3c3a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/cached_query/infinit_query_list.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class _InfinitQueryListState<T> extends State<InfinitQueryList<T>> {
5454
{
5555
return InfiniteQueryBuilder<PageFetchResult<T>, String?>(
5656
query: widget.query,
57+
buildWhen: (oldState, newState)
58+
{
59+
return oldState.status != newState.status || oldState.data != newState.data || oldState.error != newState.error;
60+
},
5761
builder: (context, state, query)
5862
{
5963
if (widget.disablePullToRefresh)

0 commit comments

Comments
 (0)