Skip to content

Commit

Permalink
fix: icy image key and podfile lock (#895)
Browse files Browse the repository at this point in the history
* fix: icy image key and podfile lock
  • Loading branch information
Feichtmeier authored Aug 25, 2024
1 parent b06aa1f commit 3323883
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 51 deletions.
24 changes: 11 additions & 13 deletions lib/player/view/blurred_full_height_player_image.dart
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
import 'package:blur/blur.dart';
import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';

import '../../common/data/audio.dart';
import '../../extensions/build_context_x.dart';
import '../../extensions/theme_data_x.dart';
import '../player_model.dart';
import 'full_height_player_image.dart';

class BlurredFullHeightPlayerImage extends StatelessWidget {
class BlurredFullHeightPlayerImage extends StatelessWidget with WatchItMixin {
const BlurredFullHeightPlayerImage({
super.key,
required this.size,
required this.audio,
this.blur = 30,
this.opacity,
this.borderRadius,
});

final Size size;
final Audio? audio;
final double blur;
final double? opacity;
final BorderRadius? borderRadius;

@override
Widget build(BuildContext context) {
final theme = context.t;
final audio = watchPropertyValue((PlayerModel m) => m.audio);
final mpvMetaData = watchPropertyValue((PlayerModel m) => m.mpvMetaData);

return Opacity(
opacity: opacity ?? (theme.isLight ? 0.8 : 0.9),
key: ValueKey(
'${audio?.path ?? ''}${mpvMetaData?.icyTitle ?? ''}${audio?.albumArtUrl ?? ''}${audio?.imageUrl ?? ''}',
),
opacity: theme.isLight ? 0.8 : 0.9,
child: SizedBox(
width: size.width,
height: size.height,
child: Blur(
borderRadius: borderRadius,
blur: blur,
blur: 35,
colorOpacity: theme.isLight ? 0.6 : 0.7,
blurColor:
theme.isLight ? Colors.white : theme.scaffoldBackgroundColor,
Expand Down
7 changes: 1 addition & 6 deletions lib/player/view/bottom_player_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class BottomPlayerImage extends StatelessWidget with WatchItMixin {
Widget child;

final fallBackImage = PlayerFallBackImage(
key: const ValueKey(0),
audio: audio,
height: size,
width: size,
Expand All @@ -66,9 +65,7 @@ class BottomPlayerImage extends StatelessWidget with WatchItMixin {
dimension: size,
fallback: fallBackImage,
);
} else if (mpvMetaData?.icyTitle != null ||
audio?.albumArtUrl != null ||
audio?.imageUrl != null) {
} else {
child = PlayerRemoteSourceImage(
key: ValueKey(
'${mpvMetaData?.icyTitle ?? ''}${audio?.albumArtUrl ?? ''}${audio?.imageUrl ?? ''}',
Expand All @@ -81,8 +78,6 @@ class BottomPlayerImage extends StatelessWidget with WatchItMixin {
fallBackIcon: fallBackImage,
errorIcon: fallBackImage,
);
} else {
child = fallBackImage;
}

return AnimatedSwitcher(
Expand Down
5 changes: 1 addition & 4 deletions lib/player/view/full_height_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ class FullHeightPlayer extends StatelessWidget with WatchItMixin {
if (!isVideo) {
return Stack(
children: [
BlurredFullHeightPlayerImage(
size: size,
audio: audio,
),
BlurredFullHeightPlayerImage(size: size),
fullHeightPlayer,
],
);
Expand Down
31 changes: 12 additions & 19 deletions lib/player/view/full_height_player_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class FullHeightPlayerImage extends StatelessWidget with WatchItMixin {
final mpvMetaData = watchPropertyValue((PlayerModel m) => m.mpvMetaData);

final fallBackImage = PlayerFallBackImage(
key: const ValueKey(0),
audio: audio,
height: height ?? fullHeightPlayerImageSize,
width: width ?? fullHeightPlayerImageSize,
Expand All @@ -45,24 +44,18 @@ class FullHeightPlayerImage extends StatelessWidget with WatchItMixin {
fallback: fallBackImage,
);
} else {
if (mpvMetaData?.icyTitle != null ||
audio?.albumArtUrl != null ||
audio?.imageUrl != null) {
image = PlayerRemoteSourceImage(
mpvMetaData: mpvMetaData,
key: ValueKey(
'${mpvMetaData?.icyTitle ?? ''}${audio?.albumArtUrl ?? ''}${audio?.imageUrl ?? ''}',
),
height: height ?? fullHeightPlayerImageSize,
width: width ?? fullHeightPlayerImageSize,
audio: audio,
fit: fit,
fallBackIcon: fallBackImage,
errorIcon: fallBackImage,
);
} else {
image = fallBackImage;
}
image = PlayerRemoteSourceImage(
key: ValueKey(
'${mpvMetaData?.icyTitle ?? ''}${audio?.albumArtUrl ?? ''}${audio?.imageUrl ?? ''}',
),
mpvMetaData: mpvMetaData,
height: height ?? fullHeightPlayerImageSize,
width: width ?? fullHeightPlayerImageSize,
audio: audio,
fit: fit,
fallBackIcon: fallBackImage,
errorIcon: fallBackImage,
);
}

return SizedBox(
Expand Down
3 changes: 0 additions & 3 deletions lib/player/view/player_remote_source_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ class PlayerRemoteSourceImage extends StatelessWidget {
);

return Container(
key: ValueKey(
mpvMetaData?.icyTitle ?? audio?.imageUrl ?? audio?.albumArtUrl,
),
color: theme.cardColor,
height: height,
width: width,
Expand Down
1 change: 1 addition & 0 deletions lib/radio/view/radio_history_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class RadioHistoryTile extends StatelessWidget with PlayerMixin {
leading: simpleTile
? null
: IcyImage(
key: ValueKey(entry.value.icyTitle),
height: yaruStyled ? 34 : 40,
width: yaruStyled ? 34 : 40,
mpvMetaData: entry.value,
Expand Down
6 changes: 0 additions & 6 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ PODS:
- FlutterMacOS
- system_theme (0.0.1):
- FlutterMacOS
- tray_manager (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- wakelock_plus (0.0.1):
Expand All @@ -66,7 +64,6 @@ DEPENDENCIES:
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`)
- super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`)
- system_theme (from `Flutter/ephemeral/.symlinks/plugins/system_theme/macos`)
- tray_manager (from `Flutter/ephemeral/.symlinks/plugins/tray_manager/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
Expand Down Expand Up @@ -108,8 +105,6 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos
system_theme:
:path: Flutter/ephemeral/.symlinks/plugins/system_theme/macos
tray_manager:
:path: Flutter/ephemeral/.symlinks/plugins/tray_manager/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
wakelock_plus:
Expand All @@ -136,7 +131,6 @@ SPEC CHECKSUMS:
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3
system_theme: c7b9f6659a5caa26c9bc2284da096781e9a6fcbc
tray_manager: 9064e219c56d75c476e46b9a21182087930baf90
url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399
wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
Expand Down

0 comments on commit 3323883

Please sign in to comment.