mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: fix queue close causing exceptions
This commit is contained in:
parent
a6720d5392
commit
b09263d128
@ -34,7 +34,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
final bool useRootNavigator;
|
final bool useRootNavigator;
|
||||||
|
|
||||||
final List<Widget>? headings;
|
final List<Widget>? headings;
|
||||||
final String? tooltip;
|
final String tooltip;
|
||||||
final ValueChanged<T>? onSelected;
|
final ValueChanged<T>? onSelected;
|
||||||
|
|
||||||
final Offset offset;
|
final Offset offset;
|
||||||
@ -47,7 +47,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
this.useRootNavigator = true,
|
this.useRootNavigator = true,
|
||||||
this.headings,
|
this.headings,
|
||||||
this.onSelected,
|
this.onSelected,
|
||||||
this.tooltip,
|
required this.tooltip,
|
||||||
this.offset = Offset.zero,
|
this.offset = Offset.zero,
|
||||||
}) : assert(
|
}) : assert(
|
||||||
!(icon != null && child != null),
|
!(icon != null && child != null),
|
||||||
@ -140,7 +140,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
if (mediaQuery.mdAndUp) {
|
if (mediaQuery.mdAndUp) {
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
tooltip: TooltipContainer(
|
tooltip: TooltipContainer(
|
||||||
child: Text(tooltip ?? ''),
|
child: Text(tooltip),
|
||||||
),
|
),
|
||||||
child: IconButton.ghost(
|
child: IconButton.ghost(
|
||||||
icon: icon ?? const Icon(SpotubeIcons.moreVertical),
|
icon: icon ?? const Icon(SpotubeIcons.moreVertical),
|
||||||
@ -164,7 +164,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
|
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
tooltip: TooltipContainer(child: Text(tooltip ?? '')),
|
tooltip: TooltipContainer(child: Text(tooltip)),
|
||||||
child: Button(
|
child: Button(
|
||||||
onPressed: () => showDropdownMenu(context, Offset.zero),
|
onPressed: () => showDropdownMenu(context, Offset.zero),
|
||||||
style: const ButtonStyle.ghost(),
|
style: const ButtonStyle.ghost(),
|
||||||
@ -174,7 +174,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
tooltip: TooltipContainer(child: Text(tooltip ?? '')),
|
tooltip: TooltipContainer(child: Text(tooltip)),
|
||||||
child: IconButton.ghost(
|
child: IconButton.ghost(
|
||||||
icon: icon ?? const Icon(SpotubeIcons.moreVertical),
|
icon: icon ?? const Icon(SpotubeIcons.moreVertical),
|
||||||
onPressed: () => showDropdownMenu(context, Offset.zero),
|
onPressed: () => showDropdownMenu(context, Offset.zero),
|
||||||
|
@ -204,6 +204,7 @@ class TrackOptions extends HookConsumerWidget {
|
|||||||
final isLocalTrack = track is LocalTrack;
|
final isLocalTrack = track is LocalTrack;
|
||||||
|
|
||||||
final adaptivePopSheetList = AdaptivePopSheetList<TrackOptionValue>(
|
final adaptivePopSheetList = AdaptivePopSheetList<TrackOptionValue>(
|
||||||
|
tooltip: context.l10n.more_actions,
|
||||||
onSelected: (value) async {
|
onSelected: (value) async {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case TrackOptionValue.album:
|
case TrackOptionValue.album:
|
||||||
|
@ -164,6 +164,7 @@ class PlayerActions extends HookConsumerWidget {
|
|||||||
auth.asData?.value != null)
|
auth.asData?.value != null)
|
||||||
TrackHeartButton(track: playlist.activeTrack!),
|
TrackHeartButton(track: playlist.activeTrack!),
|
||||||
AdaptivePopSheetList<Duration>(
|
AdaptivePopSheetList<Duration>(
|
||||||
|
tooltip: context.l10n.sleep_timer,
|
||||||
offset: Offset(0, -50 * (sleepTimerEntries.values.length + 2)),
|
offset: Offset(0, -50 * (sleepTimerEntries.values.length + 2)),
|
||||||
headings: [
|
headings: [
|
||||||
Text(context.l10n.sleep_timer),
|
Text(context.l10n.sleep_timer),
|
||||||
@ -190,11 +191,18 @@ class PlayerActions extends HookConsumerWidget {
|
|||||||
enabled: customHoursEnabled,
|
enabled: customHoursEnabled,
|
||||||
onPressed: (context) async {
|
onPressed: (context) async {
|
||||||
final currentTime = TimeOfDay.now();
|
final currentTime = TimeOfDay.now();
|
||||||
final time = await showDialog<TimeOfDay>(
|
final time = await showDialog<TimeOfDay?>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => HookBuilder(builder: (context) {
|
builder: (context) => HookBuilder(builder: (context) {
|
||||||
final timeRef = useRef<TimeOfDay?>(null);
|
final timeRef = useRef<TimeOfDay?>(null);
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
|
trailing: IconButton.ghost(
|
||||||
|
size: ButtonSize.xSmall,
|
||||||
|
icon: const Icon(SpotubeIcons.close),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
ShadcnLocalizations.of(context).placeholderTimePicker,
|
ShadcnLocalizations.of(context).placeholderTimePicker,
|
||||||
),
|
),
|
||||||
|
@ -166,7 +166,7 @@ class PlayerQueue extends HookConsumerWidget {
|
|||||||
icon: const Icon(SpotubeIcons.playlistRemove),
|
icon: const Icon(SpotubeIcons.playlistRemove),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
onStop();
|
onStop();
|
||||||
Navigator.of(context).pop();
|
closeDrawer(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user