mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 05:12:00 +02:00
Save album motion videos in app storage during downloads and prefer offline playback with an aspect-aware layout. Add cache management for saved videos. Center active lyrics on opening, expand lyrics during manual scrolling, and adjust landscape header spacing. Group search rows and skeletons with dividers and remove redundant result icons. Validation: Flutter analysis clean; 723 tests passed, 4 skipped; iOS simulator build installed.
48 lines
1.4 KiB
Dart
48 lines
1.4 KiB
Dart
import 'package:audio_service/audio_service.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:spotiflac_android/widgets/motion_header_banner.dart';
|
|
import 'package:spotiflac_android/widgets/player_artwork.dart';
|
|
|
|
class MornyePlayerArtwork extends StatelessWidget {
|
|
const MornyePlayerArtwork({
|
|
super.key,
|
|
required this.mediaItem,
|
|
this.videoUrl,
|
|
this.onAspectRatioChanged,
|
|
this.onError,
|
|
});
|
|
|
|
final MediaItem mediaItem;
|
|
final String? videoUrl;
|
|
final ValueChanged<double>? onAspectRatioChanged;
|
|
final VoidCallback? onError;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final fallback = Align(
|
|
alignment: Alignment.topCenter,
|
|
child: AspectRatio(
|
|
aspectRatio: 1,
|
|
child: PlayerArtwork(
|
|
artUri: mediaItem.artUri?.toString(),
|
|
colorScheme: Theme.of(context).colorScheme,
|
|
cacheWidth:
|
|
(MediaQuery.sizeOf(context).width *
|
|
MediaQuery.devicePixelRatioOf(context))
|
|
.round(),
|
|
),
|
|
),
|
|
);
|
|
if (MediaQuery.disableAnimationsOf(context)) return fallback;
|
|
return videoUrl == null
|
|
? fallback
|
|
: MotionHeaderBanner(
|
|
key: ValueKey(videoUrl),
|
|
videoUrl: videoUrl!,
|
|
fallback: fallback,
|
|
onAspectRatioChanged: onAspectRatioChanged,
|
|
onError: onError,
|
|
);
|
|
}
|
|
}
|