leading/center not working on PageWindowTitle on Android fixed

artist-to-clickable-artists now responsive
useBreakpoint logic updated
This commit is contained in:
Kingkor Roy Tirtho 2022-03-16 18:06:42 +06:00
parent c64f329c42
commit c4c9fd7ac2
6 changed files with 44 additions and 46 deletions

View File

@ -20,8 +20,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
children: [
if (albumArt != null)
Padding(
padding: EdgeInsets.all(
breakpoint.isLessThanOrEqualTo(Breakpoints.md) ? 5.0 : 0),
padding: const EdgeInsets.all(5.0),
child: CachedNetworkImage(
imageUrl: albumArt!,
maxHeightDiskCache: 50,
@ -36,8 +35,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
},
),
),
if (breakpoint.isLessThanOrEqualTo(Breakpoints.md)) ...[
const SizedBox(width: 10),
if (breakpoint.isLessThanOrEqualTo(Breakpoints.md))
Flexible(
child: Text(
playback.currentTrack?.name ?? "Not playing",
@ -48,7 +46,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
?.copyWith(fontWeight: FontWeight.bold, color: color),
),
),
],
// title of the currently playing track
if (breakpoint.isMoreThan(Breakpoints.md))
Flexible(
@ -65,7 +63,6 @@ class PlayerTrackDetails extends HookConsumerWidget {
),
artistsToClickableArtists(
playback.currentTrack?.artists ?? [],
mainAxisAlignment: MainAxisAlignment.center,
)
],
),

View File

@ -65,7 +65,6 @@ class PlayerView extends HookConsumerWidget {
),
artistsToClickableArtists(
currentTrack?.artists ?? [],
mainAxisAlignment: MainAxisAlignment.center,
textStyle: Theme.of(context).textTheme.headline6!.copyWith(
fontWeight: FontWeight.bold,
color: paletteColor.bodyTextColor,

View File

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
@ -80,27 +82,29 @@ class Settings extends HookConsumerWidget {
],
),
const SizedBox(height: 10),
SettingsHotKeyTile(
title: "Next track global shortcut",
currentHotKey: preferences.nextTrackHotKey,
onHotKeyRecorded: (value) {
preferences.setNextTrackHotKey(value);
},
),
SettingsHotKeyTile(
title: "Prev track global shortcut",
currentHotKey: preferences.prevTrackHotKey,
onHotKeyRecorded: (value) {
preferences.setPrevTrackHotKey(value);
},
),
SettingsHotKeyTile(
title: "Play/Pause global shortcut",
currentHotKey: preferences.playPauseHotKey,
onHotKeyRecorded: (value) {
preferences.setPlayPauseHotKey(value);
},
),
if (!Platform.isAndroid && !Platform.isIOS) ...[
SettingsHotKeyTile(
title: "Next track global shortcut",
currentHotKey: preferences.nextTrackHotKey,
onHotKeyRecorded: (value) {
preferences.setNextTrackHotKey(value);
},
),
SettingsHotKeyTile(
title: "Prev track global shortcut",
currentHotKey: preferences.prevTrackHotKey,
onHotKeyRecorded: (value) {
preferences.setPrevTrackHotKey(value);
},
),
SettingsHotKeyTile(
title: "Play/Pause global shortcut",
currentHotKey: preferences.playPauseHotKey,
onHotKeyRecorded: (value) {
preferences.setPlayPauseHotKey(value);
},
),
],
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -170,8 +174,8 @@ class Settings extends HookConsumerWidget {
],
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
Wrap(
alignment: WrapAlignment.center,
children: const [
Hyperlink(
"💚 Sponsor/Donate 💚",

View File

@ -53,14 +53,14 @@ class PageWindowTitleBar extends StatelessWidget
: super(key: key);
@override
Size get preferredSize => Size.fromHeight(
!Platform.isIOS && !Platform.isAndroid ? appWindow.titleBarHeight : 0,
!Platform.isIOS && !Platform.isAndroid ? appWindow.titleBarHeight : 35,
);
@override
Widget build(BuildContext context) {
if (Platform.isIOS || Platform.isAndroid) {
return PreferredSize(
preferredSize: const Size.fromHeight(70),
preferredSize: const Size.fromHeight(300),
child: Row(
children: [
if (leading != null) leading!,

View File

@ -1,18 +1,16 @@
import 'package:flutter/material.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/SpotubePageRoute.dart';
Widget artistsToClickableArtists(
List<ArtistSimple> artists, {
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
WrapCrossAlignment crossAxisAlignment = WrapCrossAlignment.center,
WrapAlignment mainAxisAlignment = WrapAlignment.center,
TextStyle textStyle = const TextStyle(),
}) {
return Row(
return Wrap(
crossAxisAlignment: crossAxisAlignment,
mainAxisAlignment: mainAxisAlignment,
alignment: mainAxisAlignment,
children: artists
.asMap()
.entries

View File

@ -73,22 +73,22 @@ BreakpointUtils useBreakpoints() {
final utils = BreakpointUtils(breakpoint.value);
useEffect(() {
if (width >= 1920 && breakpoint.value != Breakpoints.xxl) {
if (width > 1920 && breakpoint.value != Breakpoints.xxl) {
breakpoint.value = Breakpoints.xxl;
} else if (width >= 1366 &&
width < 1920 &&
} else if (width > 1366 &&
width <= 1920 &&
breakpoint.value != Breakpoints.xl) {
breakpoint.value = Breakpoints.xl;
} else if (width >= 768 &&
width < 1366 &&
} else if (width > 768 &&
width <= 1366 &&
breakpoint.value != Breakpoints.lg) {
breakpoint.value = Breakpoints.lg;
} else if (width >= 360 &&
width < 768 &&
} else if (width > 360 &&
width <= 768 &&
breakpoint.value != Breakpoints.md) {
breakpoint.value = Breakpoints.md;
} else if (width >= 250 &&
width < 360 &&
width <= 360 &&
breakpoint.value != Breakpoints.sm) {
breakpoint.value = Breakpoints.sm;
}