diff --git a/.vscode/launch.json b/.vscode/launch.json index b3769b2bc..6c0bb0d86 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "Flutter", "type": "dart", "request": "launch", - "program": "lib/main.dart" + "program": "${workspaceFolder}/lib/main.dart" }, ], "compounds": [] diff --git a/lib/components/Library/UserAlbums.dart b/lib/components/Library/UserAlbums.dart index 866c1ddbd..2ac63cafc 100644 --- a/lib/components/Library/UserAlbums.dart +++ b/lib/components/Library/UserAlbums.dart @@ -25,6 +25,7 @@ class UserAlbums extends HookConsumerWidget { return SingleChildScrollView( child: Material( type: MaterialType.transparency, + textStyle: PlatformTheme.of(context).textTheme!.body!, color: PlatformTheme.of(context).scaffoldBackgroundColor, child: Container( width: double.infinity, diff --git a/lib/components/Library/UserArtists.dart b/lib/components/Library/UserArtists.dart index 921825dec..981027691 100644 --- a/lib/components/Library/UserArtists.dart +++ b/lib/components/Library/UserArtists.dart @@ -31,6 +31,7 @@ class UserArtists extends HookConsumerWidget { return Material( type: MaterialType.transparency, + textStyle: PlatformTheme.of(context).textTheme!.body!, color: PlatformTheme.of(context).scaffoldBackgroundColor, child: GridView.builder( itemCount: artists.length, diff --git a/lib/components/Library/UserPlaylists.dart b/lib/components/Library/UserPlaylists.dart index 705a13ddf..ecfb639b7 100644 --- a/lib/components/Library/UserPlaylists.dart +++ b/lib/components/Library/UserPlaylists.dart @@ -1,6 +1,7 @@ import 'package:fl_query_hooks/fl_query_hooks.dart'; import 'package:flutter/material.dart' hide Image; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; import 'package:spotube/components/Playlist/PlaylistCard.dart'; @@ -36,6 +37,7 @@ class UserPlaylists extends HookConsumerWidget { return SingleChildScrollView( child: Material( type: MaterialType.transparency, + textStyle: PlatformTheme.of(context).textTheme!.body!, child: Container( width: double.infinity, padding: const EdgeInsets.all(8.0), diff --git a/lib/components/Lyrics/LyricDelayAdjustDialog.dart b/lib/components/Lyrics/LyricDelayAdjustDialog.dart index 402fc8968..4a6dbcee4 100644 --- a/lib/components/Lyrics/LyricDelayAdjustDialog.dart +++ b/lib/components/Lyrics/LyricDelayAdjustDialog.dart @@ -49,13 +49,10 @@ class LyricDelayAdjustDialog extends HookConsumerWidget { }, ), Flexible( - child: TextField( + child: PlatformTextField( keyboardType: TextInputType.number, controller: controller, - decoration: const InputDecoration( - isDense: true, - hintText: "Delay in milliseconds", - ), + placeholder: "Delay in milliseconds", onSubmitted: (_) { Navigator.of(context).pop( Duration( diff --git a/lib/components/Lyrics/SyncedLyrics.dart b/lib/components/Lyrics/SyncedLyrics.dart index 1edf4f97c..2b5c197c8 100644 --- a/lib/components/Lyrics/SyncedLyrics.dart +++ b/lib/components/Lyrics/SyncedLyrics.dart @@ -74,6 +74,7 @@ class SyncedLyrics extends HookConsumerWidget { height: breakpoint >= Breakpoints.md ? 50 : 30, child: Material( type: MaterialType.transparency, + textStyle: PlatformTheme.of(context).textTheme!.body!, child: Stack( children: [ Center( diff --git a/lib/components/Player/Player.dart b/lib/components/Player/Player.dart index 37e35c249..c76909ec8 100644 --- a/lib/components/Player/Player.dart +++ b/lib/components/Player/Player.dart @@ -90,6 +90,7 @@ class Player extends HookConsumerWidget { ), child: Material( type: MaterialType.transparency, + textStyle: PlatformTheme.of(context).textTheme!.body!, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ diff --git a/lib/components/Player/PlayerOverlay.dart b/lib/components/Player/PlayerOverlay.dart index a36eb9b8b..aaa3d67f5 100644 --- a/lib/components/Player/PlayerOverlay.dart +++ b/lib/components/Player/PlayerOverlay.dart @@ -62,6 +62,7 @@ class PlayerOverlay extends HookConsumerWidget { duration: const Duration(milliseconds: 250), opacity: canShow ? 1 : 0, child: Material( + textStyle: PlatformTheme.of(context).textTheme!.body!, type: MaterialType.transparency, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/components/Player/PlayerView.dart b/lib/components/Player/PlayerView.dart index 96edfcca0..15bcb0710 100644 --- a/lib/components/Player/PlayerView.dart +++ b/lib/components/Player/PlayerView.dart @@ -69,6 +69,7 @@ class PlayerView extends HookConsumerWidget { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15), child: Material( + textStyle: PlatformTheme.of(context).textTheme!.body!, color: paletteColor.color.withOpacity(.5), child: SafeArea( child: Column( diff --git a/lib/components/Player/SiblingTracksSheet.dart b/lib/components/Player/SiblingTracksSheet.dart index 605bf1bd5..ced57a973 100644 --- a/lib/components/Player/SiblingTracksSheet.dart +++ b/lib/components/Player/SiblingTracksSheet.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:spotube/components/Shared/UniversalImage.dart'; import 'package:spotube/provider/Playback.dart'; import 'package:spotube/utils/primitive_utils.dart'; @@ -59,7 +60,7 @@ class SiblingTracksSheet extends HookConsumerWidget { itemCount: playback.siblingYtVideos.length, itemBuilder: (context, index) { final video = playback.siblingYtVideos[index]; - return ListTile( + return PlatformListTile( title: Text(video.title), leading: UniversalImage( path: video.thumbnails.lowResUrl, @@ -69,7 +70,6 @@ class SiblingTracksSheet extends HookConsumerWidget { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5), ), - horizontalTitleGap: 10, trailing: Text( PrimitiveUtils.toReadableDuration( video.duration ?? Duration.zero, diff --git a/lib/components/Playlist/PlaylistCreateDialog.dart b/lib/components/Playlist/PlaylistCreateDialog.dart index 97033d5d4..30b52c68b 100644 --- a/lib/components/Playlist/PlaylistCreateDialog.dart +++ b/lib/components/Playlist/PlaylistCreateDialog.dart @@ -77,13 +77,13 @@ class PlaylistCreateDialog extends HookConsumerWidget { const SizedBox(height: 10), CheckboxListTile( value: public.value, - title: const Text("Public"), + title: const PlatformText("Public"), onChanged: (val) => public.value = val ?? false, ), const SizedBox(height: 10), CheckboxListTile( value: collaborative.value, - title: const Text("Collaborative"), + title: const PlatformText("Collaborative"), onChanged: (val) => collaborative.value = val ?? false, ), ], diff --git a/lib/components/Search/Search.dart b/lib/components/Search/Search.dart index 240246a56..681a27e39 100644 --- a/lib/components/Search/Search.dart +++ b/lib/components/Search/Search.dart @@ -78,6 +78,7 @@ class Search extends HookConsumerWidget { return SafeArea( child: Material( color: PlatformTheme.of(context).scaffoldBackgroundColor, + textStyle: PlatformTheme.of(context).textTheme!.body!, child: Column( children: [ Container( diff --git a/lib/components/Settings/About.dart b/lib/components/Settings/About.dart index 0d44dfb1e..789c413a4 100644 --- a/lib/components/Settings/About.dart +++ b/lib/components/Settings/About.dart @@ -32,7 +32,7 @@ class About extends HookWidget { return PlatformListTile( leading: const Icon(Icons.info_outline_rounded), - title: Text( + title: PlatformText( "About Spotube", style: PlatformTextTheme.of(context).body, ), @@ -48,7 +48,7 @@ class About extends HookWidget { Row( mainAxisAlignment: MainAxisAlignment.center, children: const [ - Text("Author: "), + PlatformText("Author: "), Hyperlink( "Kingkor Roy Tirtho", "https://github.com/KRTirtho", @@ -63,12 +63,12 @@ class About extends HookWidget { "💚 Sponsor/Donate 💚", "https://opencollective.com/spotube", ), - Text(" • "), + PlatformText(" • "), Hyperlink( "BSD-4-Clause LICENSE", "https://github.com/KRTirtho/spotube/blob/master/LICENSE", ), - Text(" • "), + PlatformText(" • "), Hyperlink( "Bug Report", "https://github.com/KRTirtho/spotube/issues/new?assignees=&labels=bug&template=bug_report.md&title=", @@ -76,7 +76,8 @@ class About extends HookWidget { ], ), const SizedBox(height: 10), - const Center(child: Text("© Spotube 2022. All rights reserved")) + const Center( + child: PlatformText("© Spotube 2022. All rights reserved")) ]); }, ); diff --git a/lib/components/Settings/Settings.dart b/lib/components/Settings/Settings.dart index 4bf361a03..8b9823427 100644 --- a/lib/components/Settings/Settings.dart +++ b/lib/components/Settings/Settings.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:macos_ui/macos_ui.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotube/components/Settings/About.dart'; import 'package:spotube/components/Settings/ColorSchemePickerDialog.dart'; @@ -339,17 +338,14 @@ class Settings extends HookConsumerWidget { ), AdaptiveListTile( leading: const Icon(Icons.screen_search_desktop_rounded), - title: SizedBox( + title: const SizedBox( height: 50, width: 200, child: Align( alignment: Alignment.centerLeft, - child: DefaultTextStyle( - style: PlatformTextTheme.of(context).body!, - child: const AutoSizeText( - "Format of the YouTube Search term", - maxLines: 2, - ), + child: AutoSizeText( + "Format of the YouTube Search term", + maxLines: 2, ), ), ), diff --git a/lib/components/Shared/PlaybuttonCard.dart b/lib/components/Shared/PlaybuttonCard.dart index 7f88d17ec..3ecb8eb2f 100644 --- a/lib/components/Shared/PlaybuttonCard.dart +++ b/lib/components/Shared/PlaybuttonCard.dart @@ -1,8 +1,5 @@ -import 'package:fluent_ui/fluent_ui.dart' as FluentUI; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:macos_ui/macos_ui.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotube/components/Shared/HoverBuilder.dart'; import 'package:spotube/components/Shared/SpotubeMarqueeText.dart'; @@ -54,10 +51,6 @@ class PlaybuttonCard extends HookWidget { ), ); - final titleStyle = PlatformTextTheme.of(context).body; - - final descriptionStyle = PlatformTextTheme.of(context).caption; - final splash = usePlatformProperty( (context) => PlatformProperty.multiPlatformGroup({ InkRipple.splashFactory: {TargetPlatform.android, TargetPlatform.linux}, @@ -164,8 +157,8 @@ class PlaybuttonCard extends HookWidget { height: 20, child: SpotubeMarqueeText( text: title, - style: titleStyle?.copyWith( - fontWeight: FontWeight.bold), + style: + const TextStyle(fontWeight: FontWeight.bold), isHovering: isHovering, ), ), @@ -176,7 +169,7 @@ class PlaybuttonCard extends HookWidget { height: 30, child: SpotubeMarqueeText( text: description!, - style: descriptionStyle, + style: PlatformTextTheme.of(context).caption, isHovering: isHovering, ), ), diff --git a/lib/components/Shared/SpotubeMarqueeText.dart b/lib/components/Shared/SpotubeMarqueeText.dart index 692a0027a..65583b321 100644 --- a/lib/components/Shared/SpotubeMarqueeText.dart +++ b/lib/components/Shared/SpotubeMarqueeText.dart @@ -26,12 +26,12 @@ class SpotubeMarqueeText extends HookWidget { return AutoSizeText( text, minFontSize: 13, - style: style, + style: DefaultTextStyle.of(context).style.merge(style), maxLines: 1, overflowReplacement: Marquee( key: uKey.value, text: text, - style: style, + style: DefaultTextStyle.of(context).style.merge(style), scrollAxis: Axis.horizontal, crossAxisAlignment: CrossAxisAlignment.start, blankSpace: 40.0, diff --git a/lib/components/Shared/TrackCollectionView.dart b/lib/components/Shared/TrackCollectionView.dart index b42ef7cc0..b29f1281c 100644 --- a/lib/components/Shared/TrackCollectionView.dart +++ b/lib/components/Shared/TrackCollectionView.dart @@ -155,6 +155,7 @@ class TrackCollectionView extends HookConsumerWidget { ), ), child: Material( + textStyle: PlatformTheme.of(context).textTheme!.body!, type: MaterialType.transparency, child: Padding( padding: const EdgeInsets.symmetric( diff --git a/lib/components/Shared/TrackTile.dart b/lib/components/Shared/TrackTile.dart index dedcb1bcd..e9ab605a8 100644 --- a/lib/components/Shared/TrackTile.dart +++ b/lib/components/Shared/TrackTile.dart @@ -177,6 +177,7 @@ class TrackTile extends HookConsumerWidget { ), child: Material( type: MaterialType.transparency, + textStyle: PlatformTheme.of(context).textTheme!.body!, child: Row( children: [ if (showCheck) diff --git a/lib/main.dart b/lib/main.dart index 0d7dbbe46..73df95998 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,13 +3,11 @@ import 'dart:convert'; import 'package:audio_service/audio_service.dart'; import 'package:bitsdojo_window/bitsdojo_window.dart'; import 'package:fl_query/fl_query.dart'; -import 'package:fluent_ui/fluent_ui.dart' as FluentUI; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:macos_ui/macos_ui.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:spotube/components/Shared/ReplaceDownloadedFileDialog.dart'; @@ -201,7 +199,7 @@ class SpotubeState extends ConsumerState with WidgetsBindingObserver { }; }, []); - platform = TargetPlatform.windows; + platform = TargetPlatform.macOS; return PlatformApp.router( routeInformationParser: router.routeInformationParser,