- Login-Screen im Melo-Design (Schwarz+Rot) mit Baka-Auth JWT
- AuthService fuer Token-Management ueber baka-net.de/auth
- Registrierungs-Modus + 'Ohne Login fortfahren'
- Navidrome-Credentials optional im Login aufklappbar
- SettingsScreen ersetzt AlertDialog
- BottomNav navigiert statt Dialog zu triggern
- Cloud Sync, Server verbinden, Diagnosedaten, App-Info, Abmelden
- CloudEinstellungen-Dialog entfernt, alles in CloudScreen konsolidiert
- Hardcode login('Baka','') entfernt → AuthService.benutzer
- Gradient-Statuskarte, animierte Segment-Intervall-Auswahl
- JWT Authorization statt Klartext-Passwort
- AppConfig: API-Key defaultValue entfernt (kein Fallback-Leak)
- Build crasht ohne --dart-define MELO_API_KEY
Build: split APK (arm64 19.6M, armeabi 17.1M, x86_64 21.1M)
58 lines
1.6 KiB
Dart
58 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
||
import 'package:audio_service/audio_service.dart';
|
||
import 'database/db_helper.dart';
|
||
import 'services/favoriten_service.dart';
|
||
import 'services/auth_service.dart';
|
||
import 'services/melo_logger.dart';
|
||
import 'services/audio_handler.dart';
|
||
import 'utils/farb_theme.dart';
|
||
import 'screens/home_screen.dart';
|
||
import 'screens/login_screen.dart';
|
||
|
||
void main() async {
|
||
WidgetsFlutterBinding.ensureInitialized();
|
||
|
||
// Logger startet sofort – zeichnet ALLES auf
|
||
MeloLogger().init('2.31');
|
||
|
||
try {
|
||
await DbHelper().db;
|
||
await FavoritenService().init();
|
||
// Hintergrund-Audio-Service starten
|
||
await AudioService.init(
|
||
builder: () => MeloAudioHandler(),
|
||
config: const AudioServiceConfig(
|
||
androidNotificationChannelId: 'de.baka.melo.audio',
|
||
androidNotificationChannelName: 'Melo Wiedergabe',
|
||
androidNotificationOngoing: true,
|
||
),
|
||
);
|
||
MeloLogger().zustand('start_ok', {'db': 'ok', 'audio': 'ok'});
|
||
} catch (e, stack) {
|
||
MeloLogger().fehler('App-Start', e, stack);
|
||
}
|
||
|
||
// Auth initialisieren (Token aus SharedPreferences laden)
|
||
await AuthService().initialisieren();
|
||
|
||
runApp(const MeloApp());
|
||
}
|
||
|
||
class MeloApp extends StatelessWidget {
|
||
const MeloApp({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
final auth = AuthService();
|
||
|
||
return MaterialApp(
|
||
title: 'Melo',
|
||
debugShowCheckedModeBanner: false,
|
||
theme: MeloTheme.theme,
|
||
home: auth.istEingeloggt
|
||
? const Scaffold(body: MeloHome())
|
||
: const LoginScreen(),
|
||
);
|
||
}
|
||
}
|