mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-26 12:52:40 +02:00
perf(library): stream scans and optimize queue queries
This commit is contained in:
@@ -158,7 +158,7 @@ class _CrossExtensionShareTile extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: _buildIcon(colorScheme),
|
||||
child: _buildIcon(context, colorScheme),
|
||||
),
|
||||
title: Text(
|
||||
result.displayName,
|
||||
@@ -205,7 +205,7 @@ class _CrossExtensionShareTile extends StatelessWidget {
|
||||
return Opacity(opacity: 0.5, child: tile);
|
||||
}
|
||||
|
||||
Widget _buildIcon(ColorScheme colorScheme) {
|
||||
Widget _buildIcon(BuildContext context, ColorScheme colorScheme) {
|
||||
final fallbackIcon = Icon(
|
||||
Icons.extension_rounded,
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
@@ -219,6 +219,9 @@ class _CrossExtensionShareTile extends StatelessWidget {
|
||||
width: 44,
|
||||
height: 44,
|
||||
fit: BoxFit.cover,
|
||||
cacheWidth: (44 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
cacheHeight: (44 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
filterQuality: FilterQuality.low,
|
||||
errorBuilder: (_, _, _) => fallbackIcon,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ class ExtensionAvatar extends StatelessWidget {
|
||||
width: size,
|
||||
height: size,
|
||||
fit: BoxFit.cover,
|
||||
cacheWidth: (size * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
cacheHeight: (size * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
filterQuality: FilterQuality.low,
|
||||
errorBuilder: (_, _, _) => fallback,
|
||||
);
|
||||
} else if (imageUrl != null && imageUrl!.isNotEmpty) {
|
||||
@@ -57,6 +60,9 @@ class ExtensionAvatar extends StatelessWidget {
|
||||
width: size,
|
||||
height: size,
|
||||
fit: BoxFit.cover,
|
||||
cacheWidth: (size * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
cacheHeight: (size * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
filterQuality: FilterQuality.low,
|
||||
errorBuilder: (_, _, _) => fallback,
|
||||
loadingBuilder: (context, child, progress) {
|
||||
if (progress == null) return child;
|
||||
|
||||
@@ -335,7 +335,7 @@ class _PlaylistPickerThumbnail extends StatelessWidget {
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: borderRadius,
|
||||
child: _buildCoverImage(colorScheme, size),
|
||||
child: _buildCoverImage(context, colorScheme, size),
|
||||
),
|
||||
if (isSelected) ...[
|
||||
Positioned.fill(
|
||||
@@ -368,7 +368,11 @@ class _PlaylistPickerThumbnail extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCoverImage(ColorScheme colorScheme, double size) {
|
||||
Widget _buildCoverImage(
|
||||
BuildContext context,
|
||||
ColorScheme colorScheme,
|
||||
double size,
|
||||
) {
|
||||
final customCoverPath = playlist.coverImagePath;
|
||||
if (customCoverPath != null && customCoverPath.isNotEmpty) {
|
||||
return Image.file(
|
||||
@@ -376,6 +380,9 @@ class _PlaylistPickerThumbnail extends StatelessWidget {
|
||||
width: size,
|
||||
height: size,
|
||||
fit: BoxFit.cover,
|
||||
cacheWidth: (size * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
cacheHeight: (size * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||
filterQuality: FilterQuality.low,
|
||||
errorBuilder: (_, _, _) => _iconFallback(colorScheme, size),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user