Browse Source

fix(neon): Fix list view flicker when loading

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/882/head
jld3103 1 year ago
parent
commit
7ff80a56cf
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 25
      packages/neon/neon/lib/src/widgets/list_view.dart

25
packages/neon/neon/lib/src/widgets/list_view.dart

@ -54,22 +54,21 @@ class NeonListView extends StatelessWidget {
itemCount: topFixedChildren!.length, itemCount: topFixedChildren!.length,
itemBuilder: (final context, final index) => topFixedChildren![index], itemBuilder: (final context, final index) => topFixedChildren![index],
), ),
if (isLoading) SliverToBoxAdapter(
const SliverToBoxAdapter( child: NeonLinearProgressIndicator(
child: NeonLinearProgressIndicator( visible: isLoading,
margin: EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 5, vertical: 5,
),
), ),
), ),
if (error != null) ),
SliverToBoxAdapter( SliverToBoxAdapter(
child: NeonError( child: NeonError(
error, error,
onRetry: () async => refreshIndicatorKey.currentState!.show(), onRetry: () async => refreshIndicatorKey.currentState!.show(),
),
), ),
),
if (topScrollingChildren != null) if (topScrollingChildren != null)
SliverList.builder( SliverList.builder(
itemCount: topScrollingChildren!.length, itemCount: topScrollingChildren!.length,

Loading…
Cancel
Save