🐛 Fix player screen blur background overflow

This commit is contained in:
2025-12-17 00:00:09 +08:00
parent 8e9abbc364
commit f436a8a49b

View File

@@ -68,7 +68,7 @@ class PlayerScreen extends HookConsumerWidget {
} }
}, },
loading: () => background = null, loading: () => background = null,
error: (_, __) => background = null, error: (_, _) => background = null,
); );
return Focus( return Focus(
@@ -93,72 +93,74 @@ class PlayerScreen extends HookConsumerWidget {
return KeyEventResult.ignored; return KeyEventResult.ignored;
}, },
child: Scaffold( child: Scaffold(
body: Stack( body: ClipRect(
children: [ child: Stack(
...background != null ? [background!] : [], children: [
// Main content (StreamBuilder) ...background != null ? [background!] : [],
Builder( // Main content (StreamBuilder)
builder: (context) { Builder(
if (isMobile) { builder: (context) {
return Padding( if (isMobile) {
padding: EdgeInsets.only( return Padding(
top: MediaQuery.of(context).padding.top + 64, padding: EdgeInsets.only(
), top: MediaQuery.of(context).padding.top + 64,
child: _MobileLayout( ),
child: _MobileLayout(
player: player,
tabController: tabController,
metadataAsync: metadataAsync,
media: media,
trackPath: path,
),
);
} else {
return _DesktopLayout(
player: player, player: player,
tabController: tabController,
metadataAsync: metadataAsync, metadataAsync: metadataAsync,
media: media, media: media,
trackPath: path, trackPath: path,
), );
); }
} else { },
return _DesktopLayout(
player: player,
metadataAsync: metadataAsync,
media: media,
trackPath: path,
);
}
},
),
// IconButton
Positioned(
top: MediaQuery.of(context).padding.top + 16,
left: 16,
child: IconButton(
icon: const Icon(Icons.keyboard_arrow_down),
onPressed: () => Navigator.of(context).pop(),
padding: EdgeInsets.zero,
iconSize: 24,
), ),
), // IconButton
// TabBar (if mobile)
if (isMobile)
Positioned( Positioned(
top: MediaQuery.of(context).padding.top + 14, top: MediaQuery.of(context).padding.top + 16,
left: 54, left: 16,
right: 54, child: IconButton(
child: Padding( icon: const Icon(Icons.keyboard_arrow_down),
padding: const EdgeInsets.symmetric(horizontal: 24), onPressed: () => Navigator.of(context).pop(),
child: TabBar( padding: EdgeInsets.zero,
controller: tabController, iconSize: 24,
tabAlignment: TabAlignment.fill,
tabs: const [
Tab(text: 'Cover'),
Tab(text: 'Lyrics'),
],
dividerHeight: 0,
indicatorColor: Colors.transparent,
overlayColor: WidgetStatePropertyAll(
Colors.transparent,
),
splashFactory: NoSplash.splashFactory,
),
), ),
), ),
_LyricsRefreshButton(trackPath: path), // TabBar (if mobile)
], if (isMobile)
Positioned(
top: MediaQuery.of(context).padding.top + 14,
left: 54,
right: 54,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: TabBar(
controller: tabController,
tabAlignment: TabAlignment.fill,
tabs: const [
Tab(text: 'Cover'),
Tab(text: 'Lyrics'),
],
dividerHeight: 0,
indicatorColor: Colors.transparent,
overlayColor: WidgetStatePropertyAll(
Colors.transparent,
),
splashFactory: NoSplash.splashFactory,
),
),
),
_LyricsRefreshButton(trackPath: path),
],
),
), ),
), ),
); );