mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-03 01:28:37 +02:00
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.
24 lines
771 B
Dart
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),
|
|
),
|
|
);
|
|
}
|