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