mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
feat(player): expand artwork when tapping the compact cover
This commit is contained in:
1 parent
c87c139588
commit
443a9a2bdf
3 files changed
+37
-19
No files matched your search
@@ -1395,21 +1395,36 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
|
||||
),
|
||||
),
|
||||
)
|
||||
: _transitionArtwork(
|
||||
_compactArtworkKey,
|
||||
ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
child: PlayerArtwork(
|
||||
artUri: mediaItem.artUri
|
||||
?.toString(),
|
||||
colorScheme: colorScheme,
|
||||
cacheWidth:
|
||||
(360 *
|
||||
MediaQuery.devicePixelRatioOf(
|
||||
context,
|
||||
))
|
||||
.round(),
|
||||
: Semantics(
|
||||
button: true,
|
||||
label: context
|
||||
.l10n
|
||||
.nowPlayingTabPlayer,
|
||||
child: GestureDetector(
|
||||
behavior:
|
||||
HitTestBehavior.opaque,
|
||||
onTap: () =>
|
||||
_setMornyePage(0),
|
||||
child: _transitionArtwork(
|
||||
_compactArtworkKey,
|
||||
ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12,
|
||||
),
|
||||
child: PlayerArtwork(
|
||||
artUri: mediaItem.artUri
|
||||
?.toString(),
|
||||
colorScheme:
|
||||
colorScheme,
|
||||
cacheWidth:
|
||||
(360 *
|
||||
MediaQuery.devicePixelRatioOf(
|
||||
context,
|
||||
))
|
||||
.round(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:audio_service/audio_service.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Shares one horizontal gesture between artwork and metadata. Only the
|
||||
@@ -135,6 +136,8 @@ class PlayerTrackSwipeRegion extends StatelessWidget {
|
||||
if (state == null) return child;
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
// Keep the initial movement when a cover/title tap competes with a swipe.
|
||||
dragStartBehavior: DragStartBehavior.down,
|
||||
onHorizontalDragStart: state._start,
|
||||
onHorizontalDragUpdate: state._update,
|
||||
onHorizontalDragEnd: state._finish,
|
||||
|
||||
Reference in new issue
Block a user