Browse Source

perf(neon_files): improve FilePreview performance

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/585/head
Nikolas Rimikis 1 year ago
parent
commit
13e4fb6aae
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 9
      packages/neon/neon_files/lib/widgets/file_preview.dart

9
packages/neon/neon_files/lib/widgets/file_preview.dart

@ -39,7 +39,7 @@ class FilePreview extends StatelessWidget {
return ValueListenableBuilder<bool>( return ValueListenableBuilder<bool>(
valueListenable: bloc.options.showPreviewsOption, valueListenable: bloc.options.showPreviewsOption,
builder: (final context, final showPreviews, final child) { builder: (final context, final showPreviews, final _) {
if (showPreviews && (details.hasPreview ?? false)) { if (showPreviews && (details.hasPreview ?? false)) {
final preview = FilePreviewImage( final preview = FilePreviewImage(
file: details, file: details,
@ -56,13 +56,12 @@ class FilePreview extends StatelessWidget {
return preview; return preview;
} }
return child!; return FileIcon(
},
child: FileIcon(
details.name, details.name,
color: color, color: color,
size: size.shortestSide, size: size.shortestSide,
), );
},
); );
}, },
), ),

Loading…
Cancel
Save