From 13e4fb6aae3ae51f20e5833d7f163832b666fd8e Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Sun, 20 Aug 2023 15:20:18 +0200 Subject: [PATCH] perf(neon_files): improve FilePreview performance Signed-off-by: Nikolas Rimikis --- .../neon/neon_files/lib/widgets/file_preview.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/neon/neon_files/lib/widgets/file_preview.dart b/packages/neon/neon_files/lib/widgets/file_preview.dart index 5a76d077..02865546 100644 --- a/packages/neon/neon_files/lib/widgets/file_preview.dart +++ b/packages/neon/neon_files/lib/widgets/file_preview.dart @@ -39,7 +39,7 @@ class FilePreview extends StatelessWidget { return ValueListenableBuilder( valueListenable: bloc.options.showPreviewsOption, - builder: (final context, final showPreviews, final child) { + builder: (final context, final showPreviews, final _) { if (showPreviews && (details.hasPreview ?? false)) { final preview = FilePreviewImage( file: details, @@ -56,13 +56,12 @@ class FilePreview extends StatelessWidget { return preview; } - return child!; + return FileIcon( + details.name, + color: color, + size: size.shortestSide, + ); }, - child: FileIcon( - details.name, - color: color, - size: size.shortestSide, - ), ); }, ),