From 39a77945d132d90ff323b0a22edc2a12a4749888 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sat, 12 Nov 2022 14:01:40 +0600 Subject: [PATCH] feat: player queue and sibling tracks platform decoration --- lib/components/Library/UserLibrary.dart | 2 +- lib/components/Player/PlayerQueue.dart | 18 ++++------ lib/components/Player/SiblingTracksSheet.dart | 33 +++++++++++-------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/lib/components/Library/UserLibrary.dart b/lib/components/Library/UserLibrary.dart index 98da2d1aa..2a5bffa5c 100644 --- a/lib/components/Library/UserLibrary.dart +++ b/lib/components/Library/UserLibrary.dart @@ -25,7 +25,7 @@ class UserLibrary extends HookConsumerWidget { return PlatformScaffold( appBar: PageWindowTitleBar( - titleWidth: 415, + titleWidth: 347, centerTitle: true, center: PlatformTabBar( androidIsScrollable: true, diff --git a/lib/components/Player/PlayerQueue.dart b/lib/components/Player/PlayerQueue.dart index 307b918e8..d7a04849d 100644 --- a/lib/components/Player/PlayerQueue.dart +++ b/lib/components/Player/PlayerQueue.dart @@ -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), diff --git a/lib/components/Player/SiblingTracksSheet.dart b/lib/components/Player/SiblingTracksSheet.dart index ced57a973..172aedfce 100644 --- a/lib/components/Player/SiblingTracksSheet.dart +++ b/lib/components/Player/SiblingTracksSheet.dart @@ -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,