@@ -153,23 +153,17 @@ class _SongBarState extends State<SongBar> {
153153 final isDurationAvailable =
154154 widget.showMusicDuration && widget.song['duration' ] != null ;
155155
156- if (_artworkPath != null ) {
157- return ValueListenableBuilder < bool >(
158- valueListenable : _songOfflineStatus,
159- builder : (_, isOffline, __ ) {
156+ return ValueListenableBuilder < bool >(
157+ valueListenable : _songOfflineStatus,
158+ builder : (_, isOffline, __) {
159+ if ( isOffline && _artworkPath != null ) {
160160 return _OfflineArtwork (
161161 artworkPath: _artworkPath,
162162 size: size,
163- isOffline: isOffline,
164163 primaryColor: primaryColor,
165164 );
166- },
167- );
168- }
165+ }
169166
170- return ValueListenableBuilder <bool >(
171- valueListenable: _songOfflineStatus,
172- builder: (_, isOffline, __) {
173167 return _OnlineArtwork (
174168 lowResImageUrl: _lowResImageUrl,
175169 size: size,
@@ -379,52 +373,46 @@ class _OfflineArtwork extends StatelessWidget {
379373 const _OfflineArtwork ({
380374 required this .artworkPath,
381375 required this .size,
382- required this .isOffline,
383376 required this .primaryColor,
384377 });
385378
386379 final String artworkPath;
387380 final double size;
388- final bool isOffline;
389381 final Color primaryColor;
390382
391383 @override
392384 Widget build (BuildContext context) {
393- final overlayColor = Theme .of (context).brightness == Brightness .dark
394- ? Colors .black.withValues (alpha: 0.6 )
395- : Colors .white.withValues (alpha: 0.7 );
396-
397385 return SizedBox (
398386 width: size,
399387 height: size,
400388 child: Stack (
401389 alignment: Alignment .center,
402390 children: [
403391 ClipRRect (
404- borderRadius: commonBarRadius,
392+ borderRadius: BorderRadiusGeometry .circular (
393+ commonMiniArtworkRadius,
394+ ),
405395 child: Image .file (
406396 File (artworkPath),
407397 fit: BoxFit .cover,
408398 cacheWidth: 256 ,
409399 cacheHeight: 256 ,
400+ color: Theme .of (context).colorScheme.primaryContainer,
401+ colorBlendMode: BlendMode .multiply,
402+ opacity: const AlwaysStoppedAnimation (0.45 ),
410403 ),
411404 ),
412- if (isOffline)
413- Positioned .fill (
414- child: ClipRRect (
415- borderRadius: commonBarRadius,
416- child: ColoredBox (
417- color: overlayColor,
418- child: Center (
419- child: Icon (
420- FluentIcons .cellular_off_24_filled,
421- size: 24 ,
422- color: primaryColor,
423- ),
424- ),
425- ),
405+ SizedBox (
406+ width: size - 10 ,
407+ child: FittedBox (
408+ fit: BoxFit .scaleDown,
409+ child: Icon (
410+ FluentIcons .cellular_off_24_filled,
411+ size: 24 ,
412+ color: primaryColor,
426413 ),
427414 ),
415+ ),
428416 ],
429417 ),
430418 );
@@ -469,7 +457,9 @@ class _OnlineArtwork extends StatelessWidget {
469457 memCacheWidth: 256 ,
470458 memCacheHeight: 256 ,
471459 imageBuilder: (context, imageProvider) => ClipRRect (
472- borderRadius: commonBarRadius,
460+ borderRadius: BorderRadiusGeometry .circular (
461+ commonMiniArtworkRadius,
462+ ),
473463 child: Stack (
474464 alignment: Alignment .center,
475465 children: [
0 commit comments