mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fix: ios dialog action buttons, local tracks crashing app, shimmer color and android wrong status bar color
This commit is contained in:
parent
359fcee98c
commit
90c1200a08
@ -242,7 +242,8 @@ class UserLocalTracks extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
loading: () => const ShimmerTrackTile(noSliver: true),
|
loading: () =>
|
||||||
|
const Expanded(child: ShimmerTrackTile(noSliver: true)),
|
||||||
error: (error, stackTrace) =>
|
error: (error, stackTrace) =>
|
||||||
Text(error.toString() + stackTrace.toString()),
|
Text(error.toString() + stackTrace.toString()),
|
||||||
)
|
)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -21,25 +22,57 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
|
|||||||
macosAppIcon: Sidebar.brandLogo(),
|
macosAppIcon: Sidebar.brandLogo(),
|
||||||
title: const Center(child: Text("Adjust Lyrics Delay")),
|
title: const Center(child: Text("Adjust Lyrics Delay")),
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
isSecondary: true,
|
fallback: PlatformBuilderFallback.android,
|
||||||
onPressed: () {
|
android: (context, _) {
|
||||||
Navigator.of(context).pop();
|
return PlatformFilledButton(
|
||||||
|
isSecondary: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
isDestructiveAction: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: const Text("Cancel"),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
primaryActions: [
|
primaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
child: const Text("Done"),
|
fallback: PlatformBuilderFallback.android,
|
||||||
onPressed: () {
|
android: (context, _) {
|
||||||
Navigator.of(context).pop(
|
return PlatformFilledButton(
|
||||||
Duration(
|
child: const Text("Done"),
|
||||||
milliseconds: getValue().toInt(),
|
onPressed: () {
|
||||||
),
|
Navigator.of(context).pop(
|
||||||
|
Duration(
|
||||||
|
milliseconds: getValue().toInt(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop(
|
||||||
|
Duration(
|
||||||
|
milliseconds: getValue().toInt(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
isDefaultAction: true,
|
||||||
|
child: const Text("Done"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
content: SizedBox(
|
content: SizedBox(
|
||||||
height: 100,
|
height: 100,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:fl_query/fl_query.dart';
|
import 'package:fl_query/fl_query.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -25,36 +26,66 @@ class PlaylistCreateDialog extends HookConsumerWidget {
|
|||||||
final public = useState(false);
|
final public = useState(false);
|
||||||
final collaborative = useState(false);
|
final collaborative = useState(false);
|
||||||
|
|
||||||
|
onCreate() async {
|
||||||
|
if (playlistName.text.isEmpty) return;
|
||||||
|
final me = await spotify.me.get();
|
||||||
|
await spotify.playlists.createPlaylist(
|
||||||
|
me.id!,
|
||||||
|
playlistName.text,
|
||||||
|
collaborative: collaborative.value,
|
||||||
|
public: public.value,
|
||||||
|
description: description.text,
|
||||||
|
);
|
||||||
|
await QueryBowl.of(context)
|
||||||
|
.getQuery(
|
||||||
|
Queries.playlist.ofMine.queryKey,
|
||||||
|
)
|
||||||
|
?.refetch();
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
|
||||||
return PlatformAlertDialog(
|
return PlatformAlertDialog(
|
||||||
macosAppIcon: Sidebar.brandLogo(),
|
macosAppIcon: Sidebar.brandLogo(),
|
||||||
title: const Text("Create a Playlist"),
|
title: const Text("Create a Playlist"),
|
||||||
primaryActions: [
|
primaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
child: const Text("Create"),
|
fallback: PlatformBuilderFallback.android,
|
||||||
onPressed: () async {
|
android: (context, _) {
|
||||||
if (playlistName.text.isEmpty) return;
|
return PlatformFilledButton(
|
||||||
final me = await spotify.me.get();
|
onPressed: onCreate,
|
||||||
await spotify.playlists.createPlaylist(
|
child: const Text("Create"),
|
||||||
me.id!,
|
|
||||||
playlistName.text,
|
|
||||||
collaborative: collaborative.value,
|
|
||||||
public: public.value,
|
|
||||||
description: description.text,
|
|
||||||
);
|
);
|
||||||
await QueryBowl.of(context)
|
|
||||||
.getQuery(
|
|
||||||
Queries.playlist.ofMine.queryKey,
|
|
||||||
)
|
|
||||||
?.refetch();
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
},
|
||||||
)
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
isDefaultAction: true,
|
||||||
|
onPressed: onCreate,
|
||||||
|
child: const Text("Create"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
isSecondary: true,
|
fallback: PlatformBuilderFallback.android,
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
android: (context, _) {
|
||||||
child: const Text("Cancel"),
|
return PlatformFilledButton(
|
||||||
|
isSecondary: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
isDestructiveAction: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
content: Container(
|
content: Container(
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -67,32 +68,60 @@ class ColorSchemePickerDialog extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
).key);
|
).key);
|
||||||
|
|
||||||
|
onOk() {
|
||||||
|
switch (schemeType) {
|
||||||
|
case ColorSchemeType.accent:
|
||||||
|
preferences.setAccentColorScheme(colorsMap[active.value]!);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
preferences.setBackgroundColorScheme(
|
||||||
|
colorsMap[active.value]!,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
|
||||||
return PlatformAlertDialog(
|
return PlatformAlertDialog(
|
||||||
macosAppIcon: Sidebar.brandLogo(),
|
macosAppIcon: Sidebar.brandLogo(),
|
||||||
title: Text("Pick ${schemeType.name} color scheme"),
|
title: Text("Pick ${schemeType.name} color scheme"),
|
||||||
primaryActions: [
|
primaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
child: const Text("Save"),
|
android: (context, data) {
|
||||||
onPressed: () {
|
return PlatformFilledButton(
|
||||||
switch (schemeType) {
|
onPressed: onOk,
|
||||||
case ColorSchemeType.accent:
|
child: const Text("Save"),
|
||||||
preferences.setAccentColorScheme(colorsMap[active.value]!);
|
);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
preferences.setBackgroundColorScheme(
|
|
||||||
colorsMap[active.value]!,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
},
|
||||||
)
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: onOk,
|
||||||
|
isDefaultAction: true,
|
||||||
|
child: const Text("Save"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
fallback: PlatformBuilderFallback.android,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
isSecondary: true,
|
fallback: PlatformBuilderFallback.android,
|
||||||
child: const Text("Cancel"),
|
android: (context, _) {
|
||||||
onPressed: () {
|
return PlatformFilledButton(
|
||||||
Navigator.pop(context);
|
isSecondary: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
isDestructiveAction: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:platform_ui/platform_ui.dart';
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
import 'package:spotube/components/shared/image/universal_image.dart';
|
import 'package:spotube/components/shared/image/universal_image.dart';
|
||||||
@ -62,20 +63,46 @@ class ConfirmDownloadDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
primaryActions: [
|
primaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
style: const ButtonStyle(
|
android: (context, _) {
|
||||||
foregroundColor: MaterialStatePropertyAll(Colors.white),
|
return PlatformFilledButton(
|
||||||
backgroundColor: MaterialStatePropertyAll(Colors.red),
|
style: const ButtonStyle(
|
||||||
),
|
foregroundColor: MaterialStatePropertyAll(Colors.white),
|
||||||
onPressed: () => Navigator.of(context).pop(true),
|
backgroundColor: MaterialStatePropertyAll(Colors.red),
|
||||||
child: const Text("Accept"),
|
),
|
||||||
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
child: const Text("Accept"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
isDestructiveAction: true,
|
||||||
|
child: const Text("Accept"),
|
||||||
|
);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
isSecondary: true,
|
fallback: PlatformBuilderFallback.android,
|
||||||
child: const Text("Decline"),
|
android: (context, _) {
|
||||||
onPressed: () => Navigator.of(context).pop(false),
|
return PlatformFilledButton(
|
||||||
|
child: const Text("Decline"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, false);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, false);
|
||||||
|
},
|
||||||
|
isDefaultAction: true,
|
||||||
|
child: const Text("Decline"),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:fl_query_hooks/fl_query_hooks.dart';
|
import 'package:fl_query_hooks/fl_query_hooks.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -31,36 +32,66 @@ class PlaylistAddTrackDialog extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
final playlistsCheck = useState(<String, bool>{});
|
final playlistsCheck = useState(<String, bool>{});
|
||||||
|
|
||||||
|
Future<void> onAdd() async {
|
||||||
|
final selectedPlaylists = playlistsCheck.value.entries
|
||||||
|
.where((entry) => entry.value)
|
||||||
|
.map((entry) => entry.key);
|
||||||
|
|
||||||
|
await Future.wait(
|
||||||
|
selectedPlaylists.map(
|
||||||
|
(playlistId) => spotify.playlists.addTracks(
|
||||||
|
tracks
|
||||||
|
.map(
|
||||||
|
(track) => track.uri!,
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
playlistId),
|
||||||
|
),
|
||||||
|
).then((_) => Navigator.pop(context));
|
||||||
|
}
|
||||||
|
|
||||||
return PlatformAlertDialog(
|
return PlatformAlertDialog(
|
||||||
title: const PlatformText("Add to Playlist"),
|
title: const PlatformText("Add to Playlist"),
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
isSecondary: true,
|
fallback: PlatformBuilderFallback.android,
|
||||||
child: const PlatformText("Cancel"),
|
android: (context, _) {
|
||||||
onPressed: () => Navigator.pop(context),
|
return PlatformFilledButton(
|
||||||
|
isSecondary: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
isDestructiveAction: true,
|
||||||
|
child: const Text("Cancel"),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
primaryActions: [
|
primaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
child: const PlatformText("Add"),
|
fallback: PlatformBuilderFallback.android,
|
||||||
onPressed: () async {
|
android: (context, _) {
|
||||||
final selectedPlaylists = playlistsCheck.value.entries
|
return PlatformFilledButton(
|
||||||
.where((entry) => entry.value)
|
onPressed: onAdd,
|
||||||
.map((entry) => entry.key);
|
child: const Text("Add"),
|
||||||
|
);
|
||||||
await Future.wait(
|
|
||||||
selectedPlaylists.map(
|
|
||||||
(playlistId) => spotify.playlists.addTracks(
|
|
||||||
tracks
|
|
||||||
.map(
|
|
||||||
(track) => track.uri!,
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
playlistId),
|
|
||||||
),
|
|
||||||
).then((_) => Navigator.pop(context));
|
|
||||||
},
|
},
|
||||||
)
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
isDefaultAction: true,
|
||||||
|
onPressed: onAdd,
|
||||||
|
child: const Text("Add"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
content: SizedBox(
|
content: SizedBox(
|
||||||
height: 300,
|
height: 300,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:platform_ui/platform_ui.dart';
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
@ -51,19 +52,47 @@ class ReplaceDownloadedDialog extends ConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
primaryActions: [
|
primaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
child: const Text("Yes"),
|
fallback: PlatformBuilderFallback.android,
|
||||||
onPressed: () {
|
android: (context, _) {
|
||||||
Navigator.pop(context, true);
|
return PlatformFilledButton(
|
||||||
|
child: const Text("Yes"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
)
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
},
|
||||||
|
isDefaultAction: true,
|
||||||
|
child: const Text("Yes"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
PlatformFilledButton(
|
PlatformBuilder(
|
||||||
isSecondary: true,
|
fallback: PlatformBuilderFallback.android,
|
||||||
child: const Text("No"),
|
android: (context, _) {
|
||||||
onPressed: () {
|
return PlatformFilledButton(
|
||||||
Navigator.pop(context, false);
|
isSecondary: true,
|
||||||
|
child: const Text("No"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, false);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
ios: (context, data) {
|
||||||
|
return CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, false);
|
||||||
|
},
|
||||||
|
isDestructiveAction: true,
|
||||||
|
child: const Text("No"),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
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:platform_ui/platform_ui.dart';
|
||||||
import 'package:skeleton_text/skeleton_text.dart';
|
import 'package:skeleton_text/skeleton_text.dart';
|
||||||
import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart';
|
import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart';
|
||||||
import 'package:spotube/extensions/theme.dart';
|
import 'package:spotube/extensions/theme.dart';
|
||||||
@ -10,12 +11,14 @@ class ShimmerArtistProfile extends HookWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final shimmerColor =
|
final isDark = PlatformTheme.of(context).brightness == Brightness.dark;
|
||||||
Theme.of(context).extension<ShimmerColorTheme>()?.shimmerColor ??
|
final shimmerTheme = ShimmerColorTheme(
|
||||||
Colors.white;
|
shimmerBackgroundColor: isDark ? Colors.grey[700] : Colors.grey[200],
|
||||||
final shimmerBackgroundColor = Theme.of(context)
|
shimmerColor: isDark ? Colors.grey[800] : Colors.grey[300],
|
||||||
.extension<ShimmerColorTheme>()
|
);
|
||||||
?.shimmerBackgroundColor;
|
final shimmerColor = shimmerTheme.shimmerColor ?? Colors.white;
|
||||||
|
final shimmerBackgroundColor =
|
||||||
|
shimmerTheme.shimmerBackgroundColor ?? Colors.grey;
|
||||||
|
|
||||||
final avatarWidth = useBreakpointValue(
|
final avatarWidth = useBreakpointValue(
|
||||||
sm: MediaQuery.of(context).size.width * 0.80,
|
sm: MediaQuery.of(context).size.width * 0.80,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart';
|
import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart';
|
||||||
import 'package:spotube/extensions/theme.dart';
|
import 'package:spotube/extensions/theme.dart';
|
||||||
|
|
||||||
@ -7,13 +8,12 @@ class ShimmerCategories extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final shimmerColor =
|
final isDark = PlatformTheme.of(context).brightness == Brightness.dark;
|
||||||
Theme.of(context).extension<ShimmerColorTheme>()?.shimmerColor ??
|
final shimmerTheme = ShimmerColorTheme(
|
||||||
Colors.white;
|
shimmerBackgroundColor: isDark ? Colors.grey[700] : Colors.grey[200],
|
||||||
final shimmerBackgroundColor = Theme.of(context)
|
);
|
||||||
.extension<ShimmerColorTheme>()
|
final shimmerBackgroundColor =
|
||||||
?.shimmerBackgroundColor ??
|
shimmerTheme.shimmerBackgroundColor ?? Colors.grey;
|
||||||
Colors.grey;
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
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:platform_ui/platform_ui.dart';
|
||||||
import 'package:skeleton_text/skeleton_text.dart';
|
import 'package:skeleton_text/skeleton_text.dart';
|
||||||
import 'package:spotube/extensions/theme.dart';
|
import 'package:spotube/extensions/theme.dart';
|
||||||
import 'package:spotube/hooks/use_breakpoints.dart';
|
import 'package:spotube/hooks/use_breakpoints.dart';
|
||||||
@ -11,13 +12,14 @@ class ShimmerLyrics extends HookWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final shimmerColor =
|
final isDark = PlatformTheme.of(context).brightness == Brightness.dark;
|
||||||
Theme.of(context).extension<ShimmerColorTheme>()?.shimmerColor ??
|
final shimmerTheme = ShimmerColorTheme(
|
||||||
Colors.white;
|
shimmerBackgroundColor: isDark ? Colors.grey[700] : Colors.grey[200],
|
||||||
final shimmerBackgroundColor = Theme.of(context)
|
shimmerColor: isDark ? Colors.grey[800] : Colors.grey[300],
|
||||||
.extension<ShimmerColorTheme>()
|
);
|
||||||
?.shimmerBackgroundColor ??
|
final shimmerColor = shimmerTheme.shimmerColor ?? Colors.white;
|
||||||
Colors.grey;
|
final shimmerBackgroundColor =
|
||||||
|
shimmerTheme.shimmerBackgroundColor ?? Colors.grey;
|
||||||
|
|
||||||
final breakpoint = useBreakpoints();
|
final breakpoint = useBreakpoints();
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
import 'package:spotube/extensions/theme.dart';
|
import 'package:spotube/extensions/theme.dart';
|
||||||
|
|
||||||
class ShimmerPlaybuttonCardPainter extends CustomPainter {
|
class ShimmerPlaybuttonCardPainter extends CustomPainter {
|
||||||
@ -52,7 +53,11 @@ class ShimmerPlaybuttonCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final shimmerTheme = Theme.of(context).extension<ShimmerColorTheme>();
|
final isDark = PlatformTheme.of(context).brightness == Brightness.dark;
|
||||||
|
final shimmerTheme = ShimmerColorTheme(
|
||||||
|
shimmerBackgroundColor: isDark ? Colors.grey[700] : Colors.grey[200],
|
||||||
|
shimmerColor: isDark ? Colors.grey[800] : Colors.grey[300],
|
||||||
|
);
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -61,10 +66,10 @@ class ShimmerPlaybuttonCard extends StatelessWidget {
|
|||||||
CustomPaint(
|
CustomPaint(
|
||||||
size: const Size(200, 250),
|
size: const Size(200, 250),
|
||||||
painter: ShimmerPlaybuttonCardPainter(
|
painter: ShimmerPlaybuttonCardPainter(
|
||||||
background: shimmerTheme?.shimmerBackgroundColor ??
|
background: shimmerTheme.shimmerBackgroundColor ??
|
||||||
Theme.of(context).scaffoldBackgroundColor,
|
Theme.of(context).scaffoldBackgroundColor,
|
||||||
foreground:
|
foreground:
|
||||||
shimmerTheme?.shimmerColor ?? Theme.of(context).cardColor,
|
shimmerTheme.shimmerColor ?? Theme.of(context).cardColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
import 'package:spotube/extensions/theme.dart';
|
import 'package:spotube/extensions/theme.dart';
|
||||||
|
|
||||||
class ShimmerTrackTilePainter extends CustomPainter {
|
class ShimmerTrackTilePainter extends CustomPainter {
|
||||||
@ -66,7 +67,11 @@ class ShimmerTrackTile extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final shimmerTheme = Theme.of(context).extension<ShimmerColorTheme>();
|
final isDark = PlatformTheme.of(context).brightness == Brightness.dark;
|
||||||
|
final shimmerTheme = ShimmerColorTheme(
|
||||||
|
shimmerBackgroundColor: isDark ? Colors.grey[700] : Colors.grey[200],
|
||||||
|
shimmerColor: isDark ? Colors.grey[800] : Colors.grey[300],
|
||||||
|
);
|
||||||
|
|
||||||
if (noSliver) {
|
if (noSliver) {
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
@ -77,10 +82,10 @@ class ShimmerTrackTile extends StatelessWidget {
|
|||||||
child: CustomPaint(
|
child: CustomPaint(
|
||||||
size: const Size(double.infinity, 50),
|
size: const Size(double.infinity, 50),
|
||||||
painter: ShimmerTrackTilePainter(
|
painter: ShimmerTrackTilePainter(
|
||||||
background: shimmerTheme?.shimmerBackgroundColor ??
|
background: shimmerTheme.shimmerBackgroundColor ??
|
||||||
Theme.of(context).scaffoldBackgroundColor,
|
Theme.of(context).scaffoldBackgroundColor,
|
||||||
foreground:
|
foreground:
|
||||||
shimmerTheme?.shimmerColor ?? Theme.of(context).cardColor,
|
shimmerTheme.shimmerColor ?? Theme.of(context).cardColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -98,7 +98,7 @@ class TrackCollectionView<T> extends HookConsumerWidget {
|
|||||||
final collapsed = useState(false);
|
final collapsed = useState(false);
|
||||||
|
|
||||||
useCustomStatusBarColor(
|
useCustomStatusBarColor(
|
||||||
color?.color ?? Theme.of(context).backgroundColor,
|
color?.color ?? PlatformTheme.of(context).scaffoldBackgroundColor!,
|
||||||
GoRouter.of(context).location == routePath,
|
GoRouter.of(context).location == routePath,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
|
|
||||||
void useCustomStatusBarColor(
|
void useCustomStatusBarColor(
|
||||||
Color color,
|
Color color,
|
||||||
@ -8,7 +9,7 @@ void useCustomStatusBarColor(
|
|||||||
bool noSetBGColor = false,
|
bool noSetBGColor = false,
|
||||||
}) {
|
}) {
|
||||||
final context = useContext();
|
final context = useContext();
|
||||||
final backgroundColor = Theme.of(context).backgroundColor;
|
final backgroundColor = PlatformTheme.of(context).scaffoldBackgroundColor!;
|
||||||
resetStatusbar() => SystemChrome.setSystemUIOverlayStyle(
|
resetStatusbar() => SystemChrome.setSystemUIOverlayStyle(
|
||||||
SystemUiOverlayStyle(
|
SystemUiOverlayStyle(
|
||||||
statusBarColor: backgroundColor, // status bar color
|
statusBarColor: backgroundColor, // status bar color
|
||||||
|
@ -89,7 +89,7 @@ class PlayerView extends HookConsumerWidget {
|
|||||||
textStyle: PlatformTheme.of(context).textTheme!.body!,
|
textStyle: PlatformTheme.of(context).textTheme!.body!,
|
||||||
color: paletteColor.color.withOpacity(.5),
|
color: paletteColor.color.withOpacity(.5),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: ListView(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
|
@ -51,7 +51,7 @@ class RootApp extends HookConsumerWidget {
|
|||||||
// checks for latest version of the application
|
// checks for latest version of the application
|
||||||
useUpdateChecker(ref);
|
useUpdateChecker(ref);
|
||||||
|
|
||||||
final backgroundColor = Theme.of(context).backgroundColor;
|
final backgroundColor = PlatformTheme.of(context).scaffoldBackgroundColor!;
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
|
@ -126,9 +126,6 @@ final windowsTheme = fluent_ui.ThemeData.light().copyWith(
|
|||||||
iconSize: fluent_ui.ButtonState.all(20),
|
iconSize: fluent_ui.ButtonState.all(20),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
navigationPaneTheme: fluent_ui.NavigationPaneThemeData(
|
|
||||||
backgroundColor: Colors.grey[100]?.withOpacity(0.5),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
final windowsDarkTheme = fluent_ui.ThemeData.dark().copyWith(
|
final windowsDarkTheme = fluent_ui.ThemeData.dark().copyWith(
|
||||||
buttonTheme: fluent_ui.ButtonThemeData(
|
buttonTheme: fluent_ui.ButtonThemeData(
|
||||||
@ -136,9 +133,6 @@ final windowsDarkTheme = fluent_ui.ThemeData.dark().copyWith(
|
|||||||
iconSize: fluent_ui.ButtonState.all(20),
|
iconSize: fluent_ui.ButtonState.all(20),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
navigationPaneTheme: fluent_ui.NavigationPaneThemeData(
|
|
||||||
backgroundColor: Colors.grey[900]?.withOpacity(0.5),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
final macosTheme = MacosThemeData.light().copyWith(
|
final macosTheme = MacosThemeData.light().copyWith(
|
||||||
pushButtonTheme: const PushButtonThemeData(
|
pushButtonTheme: const PushButtonThemeData(
|
||||||
|
Loading…
Reference in New Issue
Block a user