feat: player queue and sibling tracks platform decoration

This commit is contained in:
Kingkor Roy Tirtho 2022-11-12 14:01:40 +06:00
parent c1868817e5
commit 39a77945d1
3 changed files with 26 additions and 27 deletions

View File

@ -25,7 +25,7 @@ class UserLibrary extends HookConsumerWidget {
return PlatformScaffold( return PlatformScaffold(
appBar: PageWindowTitleBar( appBar: PageWindowTitleBar(
titleWidth: 415, titleWidth: 347,
centerTitle: true, centerTitle: true,
center: PlatformTabBar( center: PlatformTabBar(
androidIsScrollable: true, androidIsScrollable: true,

View File

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.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:scroll_to_index/scroll_to_index.dart';
import 'package:spotube/components/Shared/NotFound.dart'; import 'package:spotube/components/Shared/NotFound.dart';
import 'package:spotube/components/Shared/TrackTile.dart'; import 'package:spotube/components/Shared/TrackTile.dart';
@ -47,9 +48,6 @@ class PlayerQueue extends HookConsumerWidget {
return null; return null;
}, []); }, []);
var titleStyle = Theme.of(context).textTheme.headline4?.copyWith(
fontWeight: FontWeight.bold,
);
return BackdropFilter( return BackdropFilter(
filter: ImageFilter.blur( filter: ImageFilter.blur(
sigmaX: 12.0, sigmaX: 12.0,
@ -61,9 +59,8 @@ class PlayerQueue extends HookConsumerWidget {
top: 5.0, top: 5.0,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context) color: PlatformTheme.of(context)
.navigationRailTheme .scaffoldBackgroundColor
.backgroundColor
?.withOpacity(0.5), ?.withOpacity(0.5),
borderRadius: borderRadius, borderRadius: borderRadius,
), ),
@ -78,16 +75,13 @@ class PlayerQueue extends HookConsumerWidget {
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
), ),
Text("Queue", style: titleStyle), PlatformText.subheading("Queue"),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text( child: PlatformText(
playback.playlist?.name ?? "", playback.playlist?.name ?? "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: Theme.of(context) style: PlatformTextTheme.of(context).body,
.textTheme
.bodyText1
?.copyWith(fontWeight: FontWeight.bold),
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),

View File

@ -41,41 +41,46 @@ class SiblingTracksSheet extends HookConsumerWidget {
margin: const EdgeInsets.all(8.0), margin: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius, borderRadius: borderRadius,
color: Theme.of(context) color: PlatformTheme.of(context)
.navigationRailTheme .scaffoldBackgroundColor!
.backgroundColor .withOpacity(.3),
?.withOpacity(0.5),
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: AppBar( appBar: PlatformAppBar(
centerTitle: true, centerTitle: true,
title: const Text('Alternative Tracks Sources'), title: PlatformText.subheading(
'Alternative Tracks Sources',
),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
toolbarOpacity: 0,
), ),
body: Padding( body: Container(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: ListView.builder( child: ListView.builder(
itemCount: playback.siblingYtVideos.length, itemCount: playback.siblingYtVideos.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final video = playback.siblingYtVideos[index]; final video = playback.siblingYtVideos[index];
return PlatformListTile( return PlatformListTile(
title: Text(video.title), title: PlatformText(video.title),
leading: UniversalImage( leading: Padding(
padding: const EdgeInsets.all(8.0),
child: UniversalImage(
path: video.thumbnails.lowResUrl, path: video.thumbnails.lowResUrl,
height: 60, height: 60,
width: 60, width: 60,
), ),
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
), ),
trailing: Text( trailing: PlatformText(
PrimitiveUtils.toReadableDuration( PrimitiveUtils.toReadableDuration(
video.duration ?? Duration.zero, video.duration ?? Duration.zero,
), ),
), ),
subtitle: Text(video.author), subtitle: PlatformText(video.author),
enabled: playback.status != PlaybackStatus.loading, enabled: playback.status != PlaybackStatus.loading,
selected: video.id == playback.track!.ytTrack.id, selected: video.id == playback.track!.ytTrack.id,
selectedTileColor: Theme.of(context).popupMenuTheme.color, selectedTileColor: Theme.of(context).popupMenuTheme.color,