From 7ff80a56cf15242cdca98a95ca96c2e4c3e5b647 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 30 Sep 2023 07:03:45 +0200 Subject: [PATCH] fix(neon): Fix list view flicker when loading Signed-off-by: jld3103 --- .../neon/neon/lib/src/widgets/list_view.dart | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/neon/neon/lib/src/widgets/list_view.dart b/packages/neon/neon/lib/src/widgets/list_view.dart index 4612e38d..142e93a0 100644 --- a/packages/neon/neon/lib/src/widgets/list_view.dart +++ b/packages/neon/neon/lib/src/widgets/list_view.dart @@ -54,22 +54,21 @@ class NeonListView extends StatelessWidget { itemCount: topFixedChildren!.length, itemBuilder: (final context, final index) => topFixedChildren![index], ), - if (isLoading) - const SliverToBoxAdapter( - child: NeonLinearProgressIndicator( - margin: EdgeInsets.symmetric( - horizontal: 10, - vertical: 5, - ), + SliverToBoxAdapter( + child: NeonLinearProgressIndicator( + visible: isLoading, + margin: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 5, ), ), - if (error != null) - SliverToBoxAdapter( - child: NeonError( - error, - onRetry: () async => refreshIndicatorKey.currentState!.show(), - ), + ), + SliverToBoxAdapter( + child: NeonError( + error, + onRetry: () async => refreshIndicatorKey.currentState!.show(), ), + ), if (topScrollingChildren != null) SliverList.builder( itemCount: topScrollingChildren!.length,