mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
leading/center not working on PageWindowTitle on Android fixed
artist-to-clickable-artists now responsive useBreakpoint logic updated
This commit is contained in:
parent
c64f329c42
commit
c4c9fd7ac2
@ -20,8 +20,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (albumArt != null)
|
if (albumArt != null)
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(
|
padding: const EdgeInsets.all(5.0),
|
||||||
breakpoint.isLessThanOrEqualTo(Breakpoints.md) ? 5.0 : 0),
|
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: albumArt!,
|
imageUrl: albumArt!,
|
||||||
maxHeightDiskCache: 50,
|
maxHeightDiskCache: 50,
|
||||||
@ -36,8 +35,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (breakpoint.isLessThanOrEqualTo(Breakpoints.md)) ...[
|
if (breakpoint.isLessThanOrEqualTo(Breakpoints.md))
|
||||||
const SizedBox(width: 10),
|
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
playback.currentTrack?.name ?? "Not playing",
|
playback.currentTrack?.name ?? "Not playing",
|
||||||
@ -48,7 +46,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
|
|||||||
?.copyWith(fontWeight: FontWeight.bold, color: color),
|
?.copyWith(fontWeight: FontWeight.bold, color: color),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
// title of the currently playing track
|
// title of the currently playing track
|
||||||
if (breakpoint.isMoreThan(Breakpoints.md))
|
if (breakpoint.isMoreThan(Breakpoints.md))
|
||||||
Flexible(
|
Flexible(
|
||||||
@ -65,7 +63,6 @@ class PlayerTrackDetails extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
artistsToClickableArtists(
|
artistsToClickableArtists(
|
||||||
playback.currentTrack?.artists ?? [],
|
playback.currentTrack?.artists ?? [],
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -65,7 +65,6 @@ class PlayerView extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
artistsToClickableArtists(
|
artistsToClickableArtists(
|
||||||
currentTrack?.artists ?? [],
|
currentTrack?.artists ?? [],
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
textStyle: Theme.of(context).textTheme.headline6!.copyWith(
|
textStyle: Theme.of(context).textTheme.headline6!.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: paletteColor.bodyTextColor,
|
color: paletteColor.bodyTextColor,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
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:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
@ -80,27 +82,29 @@ class Settings extends HookConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
SettingsHotKeyTile(
|
if (!Platform.isAndroid && !Platform.isIOS) ...[
|
||||||
title: "Next track global shortcut",
|
SettingsHotKeyTile(
|
||||||
currentHotKey: preferences.nextTrackHotKey,
|
title: "Next track global shortcut",
|
||||||
onHotKeyRecorded: (value) {
|
currentHotKey: preferences.nextTrackHotKey,
|
||||||
preferences.setNextTrackHotKey(value);
|
onHotKeyRecorded: (value) {
|
||||||
},
|
preferences.setNextTrackHotKey(value);
|
||||||
),
|
},
|
||||||
SettingsHotKeyTile(
|
),
|
||||||
title: "Prev track global shortcut",
|
SettingsHotKeyTile(
|
||||||
currentHotKey: preferences.prevTrackHotKey,
|
title: "Prev track global shortcut",
|
||||||
onHotKeyRecorded: (value) {
|
currentHotKey: preferences.prevTrackHotKey,
|
||||||
preferences.setPrevTrackHotKey(value);
|
onHotKeyRecorded: (value) {
|
||||||
},
|
preferences.setPrevTrackHotKey(value);
|
||||||
),
|
},
|
||||||
SettingsHotKeyTile(
|
),
|
||||||
title: "Play/Pause global shortcut",
|
SettingsHotKeyTile(
|
||||||
currentHotKey: preferences.playPauseHotKey,
|
title: "Play/Pause global shortcut",
|
||||||
onHotKeyRecorded: (value) {
|
currentHotKey: preferences.playPauseHotKey,
|
||||||
preferences.setPlayPauseHotKey(value);
|
onHotKeyRecorded: (value) {
|
||||||
},
|
preferences.setPlayPauseHotKey(value);
|
||||||
),
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -170,8 +174,8 @@ class Settings extends HookConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Wrap(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
alignment: WrapAlignment.center,
|
||||||
children: const [
|
children: const [
|
||||||
Hyperlink(
|
Hyperlink(
|
||||||
"💚 Sponsor/Donate 💚",
|
"💚 Sponsor/Donate 💚",
|
||||||
|
@ -53,14 +53,14 @@ class PageWindowTitleBar extends StatelessWidget
|
|||||||
: super(key: key);
|
: super(key: key);
|
||||||
@override
|
@override
|
||||||
Size get preferredSize => Size.fromHeight(
|
Size get preferredSize => Size.fromHeight(
|
||||||
!Platform.isIOS && !Platform.isAndroid ? appWindow.titleBarHeight : 0,
|
!Platform.isIOS && !Platform.isAndroid ? appWindow.titleBarHeight : 35,
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (Platform.isIOS || Platform.isAndroid) {
|
if (Platform.isIOS || Platform.isAndroid) {
|
||||||
return PreferredSize(
|
return PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(70),
|
preferredSize: const Size.fromHeight(300),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (leading != null) leading!,
|
if (leading != null) leading!,
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:spotify/spotify.dart';
|
import 'package:spotify/spotify.dart';
|
||||||
import 'package:spotube/components/Artist/ArtistProfile.dart';
|
|
||||||
import 'package:spotube/components/Shared/LinkText.dart';
|
import 'package:spotube/components/Shared/LinkText.dart';
|
||||||
import 'package:spotube/components/Shared/SpotubePageRoute.dart';
|
|
||||||
|
|
||||||
Widget artistsToClickableArtists(
|
Widget artistsToClickableArtists(
|
||||||
List<ArtistSimple> artists, {
|
List<ArtistSimple> artists, {
|
||||||
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
|
WrapCrossAlignment crossAxisAlignment = WrapCrossAlignment.center,
|
||||||
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
|
WrapAlignment mainAxisAlignment = WrapAlignment.center,
|
||||||
TextStyle textStyle = const TextStyle(),
|
TextStyle textStyle = const TextStyle(),
|
||||||
}) {
|
}) {
|
||||||
return Row(
|
return Wrap(
|
||||||
crossAxisAlignment: crossAxisAlignment,
|
crossAxisAlignment: crossAxisAlignment,
|
||||||
mainAxisAlignment: mainAxisAlignment,
|
alignment: mainAxisAlignment,
|
||||||
children: artists
|
children: artists
|
||||||
.asMap()
|
.asMap()
|
||||||
.entries
|
.entries
|
||||||
|
@ -73,22 +73,22 @@ BreakpointUtils useBreakpoints() {
|
|||||||
final utils = BreakpointUtils(breakpoint.value);
|
final utils = BreakpointUtils(breakpoint.value);
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
if (width >= 1920 && breakpoint.value != Breakpoints.xxl) {
|
if (width > 1920 && breakpoint.value != Breakpoints.xxl) {
|
||||||
breakpoint.value = Breakpoints.xxl;
|
breakpoint.value = Breakpoints.xxl;
|
||||||
} else if (width >= 1366 &&
|
} else if (width > 1366 &&
|
||||||
width < 1920 &&
|
width <= 1920 &&
|
||||||
breakpoint.value != Breakpoints.xl) {
|
breakpoint.value != Breakpoints.xl) {
|
||||||
breakpoint.value = Breakpoints.xl;
|
breakpoint.value = Breakpoints.xl;
|
||||||
} else if (width >= 768 &&
|
} else if (width > 768 &&
|
||||||
width < 1366 &&
|
width <= 1366 &&
|
||||||
breakpoint.value != Breakpoints.lg) {
|
breakpoint.value != Breakpoints.lg) {
|
||||||
breakpoint.value = Breakpoints.lg;
|
breakpoint.value = Breakpoints.lg;
|
||||||
} else if (width >= 360 &&
|
} else if (width > 360 &&
|
||||||
width < 768 &&
|
width <= 768 &&
|
||||||
breakpoint.value != Breakpoints.md) {
|
breakpoint.value != Breakpoints.md) {
|
||||||
breakpoint.value = Breakpoints.md;
|
breakpoint.value = Breakpoints.md;
|
||||||
} else if (width >= 250 &&
|
} else if (width >= 250 &&
|
||||||
width < 360 &&
|
width <= 360 &&
|
||||||
breakpoint.value != Breakpoints.sm) {
|
breakpoint.value != Breakpoints.sm) {
|
||||||
breakpoint.value = Breakpoints.sm;
|
breakpoint.value = Breakpoints.sm;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user