Files
SpotiFLAC-Mobile/lib/widgets/view_queue_snackbar_action.dart
T
zarzet 424ca5d77e feat(ux): unify added-to-queue snackbars and add fetch retry
Every single-track enqueue now shows the shared added-to-queue
snackbar with a View action into Library (six call sites through one
helper). URL fetch failures in Home and via share intent gain a Retry
action; unrecognized-URL errors deliberately keep none since retrying
is deterministic.
2026-07-26 19:00:31 +07:00

24 lines
771 B
Dart

import 'package:flutter/material.dart';
import 'package:spotiflac_android/l10n/l10n.dart';
import 'package:spotiflac_android/services/shell_navigation_service.dart';
SnackBarAction buildViewQueueSnackBarAction(BuildContext context) {
return SnackBarAction(
label: context.l10n.snackbarViewQueue,
onPressed: () {
ShellNavigationService.requestTab(ShellTab.library);
},
);
}
/// Shared "Added to queue" snackbar with a View action jumping to Library.
void showAddedToQueueSnackBar(BuildContext context, String trackName) {
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(context.l10n.snackbarAddedToQueue(trackName)),
action: buildViewQueueSnackBarAction(context),
),
);
}