mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
feat: player queue and sibling tracks platform decoration
This commit is contained in:
parent
c1868817e5
commit
39a77945d1
@ -25,7 +25,7 @@ class UserLibrary extends HookConsumerWidget {
|
||||
|
||||
return PlatformScaffold(
|
||||
appBar: PageWindowTitleBar(
|
||||
titleWidth: 415,
|
||||
titleWidth: 347,
|
||||
centerTitle: true,
|
||||
center: PlatformTabBar(
|
||||
androidIsScrollable: true,
|
||||
|
@ -3,6 +3,7 @@ import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:platform_ui/platform_ui.dart';
|
||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
import 'package:spotube/components/Shared/NotFound.dart';
|
||||
import 'package:spotube/components/Shared/TrackTile.dart';
|
||||
@ -47,9 +48,6 @@ class PlayerQueue extends HookConsumerWidget {
|
||||
return null;
|
||||
}, []);
|
||||
|
||||
var titleStyle = Theme.of(context).textTheme.headline4?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
return BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: 12.0,
|
||||
@ -61,9 +59,8 @@ class PlayerQueue extends HookConsumerWidget {
|
||||
top: 5.0,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.navigationRailTheme
|
||||
.backgroundColor
|
||||
color: PlatformTheme.of(context)
|
||||
.scaffoldBackgroundColor
|
||||
?.withOpacity(0.5),
|
||||
borderRadius: borderRadius,
|
||||
),
|
||||
@ -78,16 +75,13 @@ class PlayerQueue extends HookConsumerWidget {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
),
|
||||
Text("Queue", style: titleStyle),
|
||||
PlatformText.subheading("Queue"),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
child: PlatformText(
|
||||
playback.playlist?.name ?? "",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
style: PlatformTextTheme.of(context).body,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
@ -41,41 +41,46 @@ class SiblingTracksSheet extends HookConsumerWidget {
|
||||
margin: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: borderRadius,
|
||||
color: Theme.of(context)
|
||||
.navigationRailTheme
|
||||
.backgroundColor
|
||||
?.withOpacity(0.5),
|
||||
color: PlatformTheme.of(context)
|
||||
.scaffoldBackgroundColor!
|
||||
.withOpacity(.3),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
appBar: PlatformAppBar(
|
||||
centerTitle: true,
|
||||
title: const Text('Alternative Tracks Sources'),
|
||||
title: PlatformText.subheading(
|
||||
'Alternative Tracks Sources',
|
||||
),
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
toolbarOpacity: 0,
|
||||
),
|
||||
body: Padding(
|
||||
body: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: ListView.builder(
|
||||
itemCount: playback.siblingYtVideos.length,
|
||||
itemBuilder: (context, index) {
|
||||
final video = playback.siblingYtVideos[index];
|
||||
return PlatformListTile(
|
||||
title: Text(video.title),
|
||||
leading: UniversalImage(
|
||||
title: PlatformText(video.title),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: UniversalImage(
|
||||
path: video.thumbnails.lowResUrl,
|
||||
height: 60,
|
||||
width: 60,
|
||||
),
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
trailing: Text(
|
||||
trailing: PlatformText(
|
||||
PrimitiveUtils.toReadableDuration(
|
||||
video.duration ?? Duration.zero,
|
||||
),
|
||||
),
|
||||
subtitle: Text(video.author),
|
||||
subtitle: PlatformText(video.author),
|
||||
enabled: playback.status != PlaybackStatus.loading,
|
||||
selected: video.id == playback.track!.ytTrack.id,
|
||||
selectedTileColor: Theme.of(context).popupMenuTheme.color,
|
||||
|
Loading…
Reference in New Issue
Block a user