v2.40 — Issue #9: Progress-Notification für Download/Upload (flutter_local_notifications)

- flutter_local_notifications ^22.2.0 hinzugefügt
- Notification-Channel 'de.baka.melo.downloads' in main() initialisiert
- DownloadService._showProgress(): Fortschritts-Notification mit ProgressBar
- DownloadService._completeNotification(): Abschluss-Notification (Erfolg/Fehler/Abbruch)
- Integration in downloadBatch(): Fortschritt pro Song, Abschluss nach Batch
- CloudScreen._upload(): Upload-Fortschritt + Abschluss-Notification
This commit is contained in:
Dustin
2026-08-02 16:04:09 +02:00
parent f23dc685cb
commit b8c206e58f
7 changed files with 228 additions and 1 deletions
+26
View File
@@ -4,6 +4,7 @@ import 'dart:io' show Platform;
import 'package:audio_service/audio_service.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'database/db_helper.dart';
import 'services/favoriten_service.dart';
import 'services/auth_service.dart';
@@ -15,12 +16,37 @@ import 'utils/farb_theme.dart';
import 'screens/home_screen.dart';
import 'screens/login_screen.dart';
/// Globaler Notification-Plugin (wird in main() initialisiert)
final FlutterLocalNotificationsPlugin notificationsPlugin =
FlutterLocalNotificationsPlugin();
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Logger startet sofort zeichnet ALLES auf
MeloLogger().init('2.35');
// ── Notifications initialisieren (Issue #9) ──
const androidInit = AndroidInitializationSettings('@mipmap/ic_launcher');
const initSettings = InitializationSettings(android: androidInit);
await notificationsPlugin.initialize(
settings: initSettings,
);
// Notification-Channel für Downloads (Fortschritt + Abschluss)
const downloadChannel = AndroidNotificationChannel(
'de.baka.melo.downloads',
'Melo Downloads',
description: 'Download-Fortschritt und Abschluss',
importance: Importance.low,
playSound: false,
enableVibration: false,
);
await notificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.createNotificationChannel(downloadChannel);
try {
await DbHelper().db;
await FavoritenService().init();