Skip to content

Commit

Permalink
feat: player queue and sibling tracks platform decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 12, 2022
1 parent c186881 commit 39a7794
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lib/components/Library/UserLibrary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UserLibrary extends HookConsumerWidget {

return PlatformScaffold(
appBar: PageWindowTitleBar(
titleWidth: 415,
titleWidth: 347,
centerTitle: true,
center: PlatformTabBar(
androidIsScrollable: true,
Expand Down
18 changes: 6 additions & 12 deletions lib/components/Player/PlayerQueue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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,
),
Expand All @@ -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),
Expand Down
33 changes: 19 additions & 14 deletions lib/components/Player/SiblingTracksSheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
path: video.thumbnails.lowResUrl,
height: 60,
width: 60,
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,
Expand Down

0 comments on commit 39a7794

Please sign in to comment.