Files
SpotiFLAC-Mobile/lib/widgets/download_queue_feedback.dart
T
zarzet 37e21b5712 feat(branding): rename app and native backend to Mornye
Rename the Dart package, Android and iOS identifiers, Rust crates, native libraries, and Discord plugin. Preserve legacy data readers and compatibility aliases.

Update localized branding, documentation, artwork, build tooling, and release artifacts. Route Telegram release notifications to @mornyeupdates and link @mornyecommunity.
2026-10-20 12:00:44 +07:00

40 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:mornye/l10n/l10n.dart';
import 'package:mornye/providers/download_queue_provider.dart';
/// Presents live queue effects while the application shell is mounted.
class DownloadQueueFeedback extends ConsumerWidget {
const DownloadQueueFeedback({super.key, required this.child});
final Widget child;
@override
Widget build(BuildContext context, WidgetRef ref) {
ref.listen(downloadQueueProvider.select((queue) => queue.reconnectRetry), (
_,
retry,
) {
if (retry == null ||
!context.mounted ||
WidgetsBinding.instance.lifecycleState != AppLifecycleState.resumed) {
return;
}
final queue = ref.read(downloadQueueProvider.notifier);
final l10n = context.l10n;
ScaffoldMessenger.of(context)
..removeCurrentSnackBar()
..showSnackBar(
SnackBar(
content: Text(l10n.queueNetworkFailedOffline(retry.failedCount)),
action: SnackBarAction(
label: l10n.dialogRetry,
onPressed: () => queue.retryAllFailed(networkOnly: true),
),
),
);
});
return child;
}
}