1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:watch_it/watch_it.dart' ;
3
3
4
- import '../../common/data/audio.dart' ;
5
4
import '../../constants.dart' ;
6
5
import '../../local_audio/view/local_cover.dart' ;
6
+ import '../player_model.dart' ;
7
7
import 'player_fall_back_image.dart' ;
8
8
import 'super_network_image.dart' ;
9
9
10
10
class FullHeightPlayerImage extends StatelessWidget with WatchItMixin {
11
11
const FullHeightPlayerImage ({
12
12
super .key,
13
- this .audio,
14
- required this .isOnline,
15
13
this .fit,
16
14
this .height,
17
15
this .width,
18
16
this .borderRadius,
19
17
});
20
18
21
- final Audio ? audio;
22
- final bool isOnline;
23
19
final BoxFit ? fit;
24
20
final double ? height, width;
25
21
final BorderRadius ? borderRadius;
26
22
27
23
@override
28
24
Widget build (BuildContext context) {
25
+ final audio = watchPropertyValue ((PlayerModel m) => m.audio);
26
+ final icyTitle =
27
+ watchPropertyValue ((PlayerModel m) => m.mpvMetaData? .icyTitle);
28
+
29
29
final fallBackImage = PlayerFallBackImage (
30
30
key: const ValueKey (0 ),
31
31
audio: audio,
@@ -37,8 +37,8 @@ class FullHeightPlayerImage extends StatelessWidget with WatchItMixin {
37
37
if (audio? .hasPathAndId == true ) {
38
38
image = LocalCover (
39
39
key: ValueKey (audio! .path),
40
- albumId: audio! .albumId! ,
41
- path: audio! .path! ,
40
+ albumId: audio.albumId! ,
41
+ path: audio.path! ,
42
42
width: width,
43
43
height: height,
44
44
fit: fit ?? BoxFit .fitHeight,
@@ -47,7 +47,11 @@ class FullHeightPlayerImage extends StatelessWidget with WatchItMixin {
47
47
} else {
48
48
if (audio? .albumArtUrl != null || audio? .imageUrl != null ) {
49
49
image = SuperNetworkImage (
50
- key: ValueKey (audio? .imageUrl ?? audio? .albumArtUrl),
50
+ key: ValueKey (
51
+ (icyTitle ?? '' ) +
52
+ (audio? .imageUrl ?? '' ) +
53
+ (audio? .albumArtUrl ?? '' ),
54
+ ),
51
55
height: height ?? fullHeightPlayerImageSize,
52
56
width: width ?? fullHeightPlayerImageSize,
53
57
audio: audio,
0 commit comments