From 09290d0d10c85d13e6aed168cb92fa89f7d8a966 Mon Sep 17 00:00:00 2001 From: ibcker Date: Wed, 17 Mar 2021 20:10:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20viewCount=20=E5=B0=911=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/loadmore_widget.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/loadmore_widget.dart b/lib/src/loadmore_widget.dart index 0d18274..121261e 100644 --- a/lib/src/loadmore_widget.dart +++ b/lib/src/loadmore_widget.dart @@ -85,7 +85,7 @@ class _LoadMoreState extends State { if (!widget.whenEmptyLoad && delegate.estimatedChildCount == 0) { break outer; } - var viewCount = delegate.estimatedChildCount ?? 0 + 1; + var viewCount = (delegate.estimatedChildCount ?? 0) + 1; IndexedWidgetBuilder builder = (context, index) { if (index == viewCount - 1) { return _buildLoadMoreView(); @@ -157,7 +157,7 @@ class _LoadMoreState extends State { if (!widget.whenEmptyLoad && delegate.estimatedChildCount == 0) { break outer; } - final viewCount = delegate.estimatedChildCount ?? 0 + 1; + final viewCount = (delegate.estimatedChildCount ?? 0) + 1; IndexedWidgetBuilder builder = (context, index) { if (index == viewCount - 1) { return _buildLoadMoreView();