Skip to content

Commit

Permalink
feat: dialog logo for macos, settings more width for country picker
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 4, 2022
1 parent 2211505 commit 5e96913
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/components/Home/Sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Sidebar extends HookConsumerWidget {
Key? key,
}) : super(key: key);

Widget _buildSmallLogo() {
static Widget brandLogo() {
return Image.asset(
"assets/spotube-logo.png",
height: 50,
Expand Down Expand Up @@ -135,7 +135,7 @@ class Sidebar extends HookConsumerWidget {
(extended.value)
? Row(
children: [
_buildSmallLogo(),
brandLogo(),
const SizedBox(
width: 10,
),
Expand All @@ -149,7 +149,7 @@ class Sidebar extends HookConsumerWidget {
),
],
)
: _buildSmallLogo(),
: brandLogo(),
],
),
windowsFooterItems: [
Expand Down
1 change: 1 addition & 0 deletions lib/components/Library/UserLibrary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class UserLibrary extends ConsumerWidget {
length: 5,
child: SafeArea(
child: PlatformTabView(
androidIsScrollable: true,
placement: PlatformProperty.all(PlatformTabbarPlacement.top),
body: {
PlatformTab(
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Lyrics/LyricDelayAdjustDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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/Home/Sidebar.dart';
import 'package:spotube/components/Lyrics/SyncedLyrics.dart';

class LyricDelayAdjustDialog extends HookConsumerWidget {
Expand All @@ -17,6 +18,7 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
double.tryParse(controller.text.replaceAll("ms", "")) ?? 0;

return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: const Center(child: Text("Adjust Lyrics Delay")),
secondaryActions: [
PlatformFilledButton(
Expand Down
1 change: 0 additions & 1 deletion lib/components/Player/PlayerControls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class PlayerControls extends HookConsumerWidget {
PlatformTooltip(
message: "Slide to seek forward or backward",
child: PlatformSlider(
focusNode: FocusNode(),
// cannot divide by zero
// there's an edge case for value being bigger
// than total duration. Keeping it resolved
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Playlist/PlaylistCreateDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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/Home/Sidebar.dart';
import 'package:spotube/provider/SpotifyDI.dart';
import 'package:spotube/provider/SpotifyRequests.dart';

Expand All @@ -25,6 +26,7 @@ class PlaylistCreateDialog extends HookConsumerWidget {
final collaborative = useState(false);

return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: const Text("Create a Playlist"),
primaryActions: [
PlatformFilledButton(
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Settings/ColorSchemePickerDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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/Home/Sidebar.dart';
import 'package:spotube/provider/UserPreferences.dart';

final highContrast = MaterialColor(
Expand Down Expand Up @@ -67,6 +68,7 @@ class ColorSchemePickerDialog extends HookConsumerWidget {
).key);

return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: Text("Pick ${schemeType.name} color scheme"),
primaryActions: [
PlatformFilledButton(
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Settings/Settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class Settings extends HookConsumerWidget {
"Recommendation Country",
),
trailing: (context, update) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 250),
constraints: const BoxConstraints(maxWidth: 350),
child: PlatformDropDownMenu(
value: preferences.recommendationMarket,
items: spotifyMarkets
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Shared/AdaptiveListTile.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/components/Home/Sidebar.dart';
import 'package:spotube/hooks/useBreakpoints.dart';

class AdaptiveListTile extends HookWidget {
Expand Down Expand Up @@ -39,6 +40,7 @@ class AdaptiveListTile extends HookWidget {
builder: (context) {
return StatefulBuilder(builder: (context, update) {
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: title != null
? Row(
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Shared/DownloadConfirmationDialog.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/components/Home/Sidebar.dart';
import 'package:spotube/components/Shared/UniversalImage.dart';

class DownloadConfirmationDialog extends StatelessWidget {
Expand All @@ -8,6 +9,7 @@ class DownloadConfirmationDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: Padding(
padding: const EdgeInsets.all(15),
child: Row(
Expand Down
4 changes: 3 additions & 1 deletion lib/components/Shared/PageWindowTitleBar.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:fluent_ui/fluent_ui.dart' show FluentTheme;
import 'package:flutter/material.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/utils/platform.dart';
Expand Down Expand Up @@ -112,7 +113,8 @@ class PageWindowTitleBar extends StatelessWidget
}
return WindowTitleBarBox(
child: Container(
color: backgroundColor,
color: backgroundColor ??
FluentTheme.maybeOf(context)?.micaBackgroundColor,
child: Row(
children: [
if (kIsMacOS)
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Shared/ReplaceDownloadedFileDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/components/Home/Sidebar.dart';

final replaceDownloadedFileState = StateProvider<bool?>((ref) => null);

Expand All @@ -15,6 +16,7 @@ class ReplaceDownloadedFileDialog extends ConsumerWidget {
final groupValue = ref.watch(replaceDownloadedFileState);

return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: Text("Track ${track.name} Already Exists"),
content: Column(
mainAxisSize: MainAxisSize.min,
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Shared/TrackTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart' hide Image;
import 'package:spotube/components/Home/Sidebar.dart';
import 'package:spotube/components/Shared/AdaptivePopupMenuButton.dart';
import 'package:spotube/components/Shared/HeartButton.dart';
import 'package:spotube/components/Shared/LinkText.dart';
Expand Down Expand Up @@ -95,6 +96,7 @@ class TrackTile extends HookConsumerWidget {
return HookBuilder(builder: (context) {
final playlistsCheck = useState(<String, bool>{});
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: PlatformText(
"Add `${track.value.name}` to following Playlists",
style: const TextStyle(
Expand Down
2 changes: 2 additions & 0 deletions lib/hooks/useUpdateChecker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/components/Home/Sidebar.dart';
import 'package:spotube/components/Shared/AnchorButton.dart';
import 'package:spotube/hooks/usePackageInfo.dart';
import 'package:spotube/provider/UserPreferences.dart';
Expand Down Expand Up @@ -56,6 +57,7 @@ void useUpdateChecker(WidgetRef ref) {
const url =
"https://spotube.netlify.app/other-downloads/stable-downloads";
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
title: const PlatformText("Spotube has an update"),
primaryActions: [
PlatformFilledButton(
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class SpotubeState extends ConsumerState<Spotube> with WidgetsBindingObserver {
};
}, []);

platform = TargetPlatform.android;
platform = TargetPlatform.macOS;

return PlatformApp.router(
routeInformationParser: router.routeInformationParser,
Expand Down
2 changes: 1 addition & 1 deletion lib/themes/dark-theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ThemeData darkTheme({
),
dialogTheme: DialogTheme(backgroundColor: backgroundMaterialColor[900]),
cardColor: backgroundMaterialColor[800],
canvasColor: backgroundMaterialColor[900],
canvasColor: backgroundMaterialColor[800],
listTileTheme: const ListTileThemeData(horizontalTitleGap: 0),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith((states) {
Expand Down

0 comments on commit 5e96913

Please sign in to comment.