Initial commit
@@ -0,0 +1,45 @@
|
|||||||
|
# Miscellaneous
|
||||||
|
*.class
|
||||||
|
*.log
|
||||||
|
*.pyc
|
||||||
|
*.swp
|
||||||
|
.DS_Store
|
||||||
|
.atom/
|
||||||
|
.build/
|
||||||
|
.buildlog/
|
||||||
|
.history
|
||||||
|
.svn/
|
||||||
|
.swiftpm/
|
||||||
|
migrate_working_dir/
|
||||||
|
|
||||||
|
# IntelliJ related
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
|
# is commented out by default.
|
||||||
|
#.vscode/
|
||||||
|
|
||||||
|
# Flutter/Dart/Pub related
|
||||||
|
**/doc/api/
|
||||||
|
**/ios/Flutter/.last_build_id
|
||||||
|
.dart_tool/
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
.pub-cache/
|
||||||
|
.pub/
|
||||||
|
/build/
|
||||||
|
/coverage/
|
||||||
|
|
||||||
|
# Symbolication related
|
||||||
|
app.*.symbols
|
||||||
|
|
||||||
|
# Obfuscation related
|
||||||
|
app.*.map.json
|
||||||
|
|
||||||
|
# Android Studio will place build artifacts here
|
||||||
|
/android/app/debug
|
||||||
|
/android/app/profile
|
||||||
|
/android/app/release
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# This file tracks properties of this Flutter project.
|
||||||
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
|
#
|
||||||
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
|
version:
|
||||||
|
revision: "c9a6c484230f8b5e408ec57be1ef71dee1e77020"
|
||||||
|
channel: "stable"
|
||||||
|
|
||||||
|
project_type: app
|
||||||
|
|
||||||
|
# Tracks metadata for the flutter migrate command
|
||||||
|
migration:
|
||||||
|
platforms:
|
||||||
|
- platform: root
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
- platform: android
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
- platform: ios
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
- platform: linux
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
- platform: macos
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
- platform: web
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
- platform: windows
|
||||||
|
create_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
base_revision: c9a6c484230f8b5e408ec57be1ef71dee1e77020
|
||||||
|
|
||||||
|
# User provided section
|
||||||
|
|
||||||
|
# List of Local paths (relative to this file) that should be
|
||||||
|
# ignored by the migrate tool.
|
||||||
|
#
|
||||||
|
# Files that are not part of the templates will be ignored by default.
|
||||||
|
unmanaged_files:
|
||||||
|
- 'lib/main.dart'
|
||||||
|
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# This directory is a Syncthing folder marker.
|
||||||
|
# Do not delete.
|
||||||
|
|
||||||
|
folderID: melo-app
|
||||||
|
created: 2026-07-23T14:21:25+02:00
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Build-Artefakte – nicht auf Server nötig
|
||||||
|
build/
|
||||||
|
.dart_tool/
|
||||||
|
.pub/
|
||||||
|
.packages
|
||||||
|
.pub-cache/
|
||||||
|
*.g.dart
|
||||||
|
*.freezed.dart
|
||||||
|
android/.gradle/
|
||||||
|
android/app/build/
|
||||||
|
ios/Pods/
|
||||||
|
ios/.symlinks/
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
@@ -0,0 +1,532 @@
|
|||||||
|
# 🔴 Melo App — Vollständiges Code-Review
|
||||||
|
|
||||||
|
> **Geprüft:** 20.07.2026 | **Projekt:** ~/Projects/melo_app/ | **Dustin (Baka) — Kiel**
|
||||||
|
> **Prinzip:** Ponytail — minimaler Code, maximale Wirkung, max 500 Zeilen pro Datei
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Kritische Bugs (MÜSSEN SOFORT GEFIXT WERDEN)
|
||||||
|
|
||||||
|
### 🔴 [CRIT-1] Memory Leak: MiniPlayer-Streams werden nie gecancelled
|
||||||
|
|
||||||
|
**Datei:** `widgets/mini_player.dart` · Zeilen 20–32
|
||||||
|
|
||||||
|
```dart
|
||||||
|
// initState abonniert Streams, aber speichert kein StreamSubscription
|
||||||
|
_player.positionStream.listen((pos) { ... });
|
||||||
|
_player.stateStream.listen((state) { ... });
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** `initState` abonniert `positionStream` und `stateStream` via `.listen()`, aber es gibt **kein** `dispose()`-Override. Die `StreamSubscription`-Objekte werden nirgends gespeichert, also können sie nie gecancelled werden. Jedes Mal wenn der MiniPlayer neu gebaut wird (z.B. bei setState im Parent), leakt ein neues Paar Subscriptions.
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
```dart
|
||||||
|
StreamSubscription? _posSub;
|
||||||
|
StreamSubscription? _stateSub;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_posSub = _player.positionStream.listen((pos) { ... });
|
||||||
|
_stateSub = _player.stateStream.listen((state) { ... });
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_posSub?.cancel();
|
||||||
|
_stateSub?.cancel();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🔴 [CRIT-2] Null-Crash: `widget.song.id!` kann explodieren
|
||||||
|
|
||||||
|
**Datei:** `widgets/metadaten_dialog.dart` · Zeile 88
|
||||||
|
|
||||||
|
```dart
|
||||||
|
await _db.metadatenAktualisieren(
|
||||||
|
widget.song.id!, // ← CRASH wenn id null ist!
|
||||||
|
...
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** `Song.id` ist `int?`. Wenn ein Song (z.B. frisch gescannter oder Beispielsong ohne DB-ID) den Metadaten-Editor öffnet, crasht die App mit `null check used on null value`.
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
```dart
|
||||||
|
final id = widget.song.id;
|
||||||
|
if (id == null) {
|
||||||
|
if (mounted) ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(content: Text('Song-ID fehlt — bitte App neustarten')),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await _db.metadatenAktualisieren(id, ...);
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🔴 [CRIT-3] `dauerSekunden` ist IMMER 0 (kein Metadaten-Parsing)
|
||||||
|
|
||||||
|
**Datei:** `services/musik_scanner.dart` · Zeilen 34–44
|
||||||
|
|
||||||
|
```dart
|
||||||
|
final song = Song(
|
||||||
|
titel: _dateiNameOhneEndung(pfad),
|
||||||
|
kuenstler: 'Unbekannt', // ← keinerlei Tag-Parsing
|
||||||
|
dauerSekunden: 0, // ← IMMER 0!
|
||||||
|
...
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Es wird nie die echte Audio-Dauer ausgelesen. Weder ID3-Tags noch MediaStore-Metadaten. Alle gescannten Songs haben `dauerSekunden: 0` → `dauerFormatiert` zeigt `"0:00"`.
|
||||||
|
|
||||||
|
**Fix:** Nutze eine Audio-Metadaten-Bibliothek wie `flutter_media_metadata` oder `audio_metadata_reader`, oder implementiere einen nativen Method-Channel für MediaStore-Query. Minimal-Fix: verwende `just_audio` kurz zum Öffnen der Datei um Duration zu lesen.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🔴 [CRIT-4] `positionAktualisieren` flutet DB mit immer neuen Einträgen
|
||||||
|
|
||||||
|
**Datei:** `database/db_helper.dart` · Zeilen 126–135
|
||||||
|
|
||||||
|
```dart
|
||||||
|
Future<void> positionAktualisieren(int songId, int position) async {
|
||||||
|
final d = await db;
|
||||||
|
await d.update('songs', {'zuletzt_position': position},
|
||||||
|
where: 'id = ?', whereArgs: [songId]);
|
||||||
|
await d.insert('wiedergabe_verlauf', { // ← IMMER INSERT!
|
||||||
|
'song_id': songId,
|
||||||
|
'position': position,
|
||||||
|
'zuletzt_abgespielt': DateTime.now().toIso8601String(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Bei jedem Positions-Update wird ein NEUER History-Eintrag inserted, ohne den alten zu löschen. Nach 30 Minuten Musik hören mit 1-Sekunden-Takt → 1800 Einträge pro Song.
|
||||||
|
|
||||||
|
**Fix Variante A (einfach):** Lösche alten Eintrag vor neuem Insert:
|
||||||
|
```dart
|
||||||
|
await d.delete('wiedergabe_verlauf', where: 'song_id = ?', whereArgs: [songId]);
|
||||||
|
await d.insert('wiedergabe_verlauf', { ... });
|
||||||
|
```
|
||||||
|
|
||||||
|
**Fix Variante B (besser):** Nur bei signifikanten Änderungen speichern (alle 30 Sekunden statt bei jedem Tick).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🔴 [CRIT-5] `FlutterErrorBoundary` tut GAR NICHTS
|
||||||
|
|
||||||
|
**Datei:** `main.dart` · Zeilen 48–62
|
||||||
|
|
||||||
|
```dart
|
||||||
|
class _FlutterErrorBoundaryState extends State<FlutterErrorBoundary> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return widget.child; // ← gibt einfach child zurück, kein Error Handling!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Das "Error Boundary" hat keinen Error-Catcher (`FlutterError.onError` oder `ErrorWidget.builder` oder `runZonedGuarded`). Es fängt genau null Fehler. Wird aber zum Glück auch nicht verwendet (der `AppWrapper` wird nie benutzt).
|
||||||
|
|
||||||
|
**Fix:** Entweder korrekt implementieren (mit `runZonedGuarded` oder `ErrorWidget.builder`) oder — besser — den ganzen `AppWrapper` + `FlutterErrorBoundary` rauswerfen (Ponytail!).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Schwere Probleme
|
||||||
|
|
||||||
|
### 🟠 [MAJ-1] Download-Fehlermeldungen werden brutal abgeschnitten
|
||||||
|
|
||||||
|
**Datei:** `services/download_service.dart` · Zeilen 56, 75, 105, 127
|
||||||
|
|
||||||
|
```dart
|
||||||
|
_fehlermeldung = 'Timeout/Fehler bei Video-Info: ${e.toString().substring(0, 80)}';
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** `.substring(0, 80)` und `.substring(0, 100)` zerstören Fehlerdetails. YouTube-Fehler (Rate Limits, Region-Locks, Copyright Claims) werden sinnlos.
|
||||||
|
|
||||||
|
**Fix:** Entweder gar nicht truncaten, oder erst auf UI-Ebene truncaten. Die Fehlermeldung sollte vollständig geloggt werden:
|
||||||
|
```dart
|
||||||
|
debugPrint('Download-Fehler (vollständig): $e');
|
||||||
|
_fehlermeldung = e.toString(); // UI zeigt nur ersten Teil, Log hat alles
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟠 [MAJ-2] MiniPlayer `dispose()` tut nichts (lebt als Memory Leak II)
|
||||||
|
|
||||||
|
**Datei:** `widgets/mini_player.dart` · Zeile 131
|
||||||
|
|
||||||
|
Kein `dispose()`-Override vorhanden! Die Klasse endet mit `Widget _playBtn() { ... }`. Dadurch werden nicht nur Streams nicht gecancelled (CRIT-1), sondern auch keine Ressourcen freigegeben.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟠 [MAJ-3] `_scanneViaMediaStore()` gibt IMMER `[]` zurück
|
||||||
|
|
||||||
|
**Datei:** `services/musik_scanner.dart` · Zeilen 121–126
|
||||||
|
|
||||||
|
```dart
|
||||||
|
Future<List<String>> _scanneViaMediaStore() async {
|
||||||
|
// Nutzt Android's MediaStore Query
|
||||||
|
// Wird über Method Channel in native Android implementiert
|
||||||
|
// Für v1: Fallback auf Dateisystem-Suche
|
||||||
|
return []; // ← TODO seit Version 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Der MediaStore-Pfad ist nie implementiert. Der Fallback auf Dateisystem-Suche ist ineffizient und findet keine Musik in App-spezifischen Verzeichnissen. Auf Android 11+ (API 30+) wird der Dateisystem-Zugriff zudem stark eingeschränkt.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟠 [MAJ-4] `_p.positionStream` referenziert möglicherweise alten Player
|
||||||
|
|
||||||
|
**Datei:** `services/player_service.dart` · Zeilen 32–33
|
||||||
|
|
||||||
|
```dart
|
||||||
|
Stream<Duration> get positionStream => _p.positionStream; // _p initiiert lazy
|
||||||
|
Stream<PlayerState> get stateStream => _p.playerStateStream;
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** `_p` initialisiert den `AudioPlayer` lazy beim ersten Zugriff. Wenn die Streams vor dem ersten `spiele()`-Aufruf abonniert werden, hängen sie an einem Player, der später ersetzt/reinitialisiert werden könnte. Der getter erzeugt keinen neuen Player, also ist das nur ein Problem wenn `_player` jemals auf null gesetzt wird (was nie passiert). Aber: `_p` wird von diesen Gettern aufgerufen → bei jedem Stream-Zugriff wird der `_player != null` Check gemacht. Das ist ok, aber es ist ein wartungsintensives Pattern.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟠 [MAJ-5] `AppWrapper` ist totes Code-Gewebe
|
||||||
|
|
||||||
|
**Datei:** `main.dart` · Zeilen 34–46
|
||||||
|
|
||||||
|
`AppWrapper` wird nirgends verwendet. `MeloApp` geht direkt zu `Scaffold(body: MeloHome())`. Der Wrapper wurde offenbar geplant aber nie aktiviert.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟠 [MAJ-6] Tag-Filter wird in Song-Liste komplett ignoriert
|
||||||
|
|
||||||
|
**Datei:** `screens/home_screen.dart` · Zeilen 374–393 + 431–434
|
||||||
|
|
||||||
|
`_aktiverTag` wird zwar gesetzt (Zeile 382), aber in `_songListe()` (Zeile 431–434) wird die Song-Liste ungefiltert angezeigt:
|
||||||
|
```dart
|
||||||
|
itemCount: _songs.length, // ← immer alle Songs, egal welcher Tag aktiv
|
||||||
|
```
|
||||||
|
|
||||||
|
Die `_beispielTags` sind zudem hardcoded (nicht aus der DB) — das Tag-System hat keinen echten Filter.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Code-Qualität & Anti-Patterns
|
||||||
|
|
||||||
|
### 🟡 [QUAL-1] Singleton-Overkill (5 von 6 Klassen sind Singletons)
|
||||||
|
|
||||||
|
| Klasse | Singleton? | Warum problematisch |
|
||||||
|
|--------|-----------|---------------------|
|
||||||
|
| `DbHelper` | ✅ | Testen unmöglich (kein Mock) |
|
||||||
|
| `PlayerService` | ✅ | State hält zwischen Tests |
|
||||||
|
| `FavoritenService` | ✅ | s.o. |
|
||||||
|
| `DownloadService` | ✅ | s.o. |
|
||||||
|
| `MusikScanner` | ✅ | s.o. |
|
||||||
|
|
||||||
|
**Fix:** Dependency Injection via Konstruktor. Services sollten das DB-Objekt injiziert bekommen statt `DbHelper()` direkt aufzurufen.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟡 [QUAL-2] HomeScreen Monolith — 519 Zeilen in einer Datei
|
||||||
|
|
||||||
|
**Datei:** `screens/home_screen.dart` · 519 Zeilen
|
||||||
|
|
||||||
|
Enthält:
|
||||||
|
- State Management
|
||||||
|
- Header-Widget
|
||||||
|
- Statistik-Widget
|
||||||
|
- Tag-Leiste
|
||||||
|
- Song-Liste
|
||||||
|
- Song-Tile
|
||||||
|
- Bottom Nav
|
||||||
|
- Download-Dialog (komplette UI + Timer-Logik!)
|
||||||
|
- Such-Dialog (komplette UI!)
|
||||||
|
- Scan-Logik
|
||||||
|
- Beispieldaten/Seed-Daten
|
||||||
|
|
||||||
|
**Ponytail-Prinzip verletzt!** Max 500 Zeilen pro Datei fast erreicht, aber die Verantwortlichkeiten sind vermischt.
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
- Extrahiere `MeloHeader`, `StatistikCard`, `TagLeiste`, `SongTile` in eigene Widget-Dateien (`widgets/`)
|
||||||
|
- Extrahiere Such- und Download-Dialoge in eigene Methoden oder Dateien
|
||||||
|
- Entferne Beispiel-Song-Seeding (gehört in einen dev-only Seeder)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟡 [QUAL-3] `loeschen()` löscht in falscher Reihenfolge
|
||||||
|
|
||||||
|
**Datei:** `database/db_helper.dart` · Zeilen 221–229
|
||||||
|
|
||||||
|
```dart
|
||||||
|
await d.delete('wiedergabe_verlauf');
|
||||||
|
await d.delete('song_tags');
|
||||||
|
await d.delete('playlist_songs');
|
||||||
|
await d.delete('playlists');
|
||||||
|
await d.delete('tags');
|
||||||
|
await d.delete('songs');
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Die Tabellen mit `ON DELETE CASCADE` werden vor den Eltern-Tabellen gelöscht. Theoretisch korrekt (CASCADE ist auf FK definiert), aber die Reihenfolge ist inkonsistent: `playlists` wird vor `tags` gelöscht, obwohl beide Eltern sind. Außerdem: **keine Transaktion!** Wenn ein Löschen fehlschlägt, hat man eine korrupte Datenbank.
|
||||||
|
|
||||||
|
**Fix:** Alles in eine Transaktion packen:
|
||||||
|
```dart
|
||||||
|
await d.transaction((txn) async {
|
||||||
|
await txn.delete('wiedergabe_verlauf');
|
||||||
|
await txn.delete('song_tags');
|
||||||
|
await txn.delete('playlist_songs');
|
||||||
|
await txn.delete('playlists');
|
||||||
|
await txn.delete('tags');
|
||||||
|
await txn.delete('songs');
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟡 [QUAL-4] Doppelter try-catch in `musik_scanner.dart`
|
||||||
|
|
||||||
|
**Datei:** `services/musik_scanner.dart` · Zeilen 29–65
|
||||||
|
|
||||||
|
Zwei verschachtelte try-catch Blöcke die fast identischen Code enthalten. Der äußere try-catch fängt alles, und der innere ist ein "vielleicht klappt es beim zweiten Versuch" — ohne ersichtlichen Grund.
|
||||||
|
|
||||||
|
**Fix:** Einfach einen try-catch:
|
||||||
|
```dart
|
||||||
|
try {
|
||||||
|
final file = File(pfad);
|
||||||
|
final stat = await file.stat();
|
||||||
|
gefunden.add(/* Song erstellen */);
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('Datei nicht lesbar: $pfad — $e');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🟡 [QUAL-5] `favoritenIds()` ist ineffizient (lädt alle Songs nur für IDs)
|
||||||
|
|
||||||
|
**Datei:** `services/favoriten_service.dart` · Zeilen 45–49
|
||||||
|
|
||||||
|
```dart
|
||||||
|
Future<Set<int>> favoritenIds() async {
|
||||||
|
final songs = await _db.songsDerPlaylist(_favoritenPlaylistId!);
|
||||||
|
return songs.where((s) => s.id != null).map((s) => s.id!).toSet();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Lädt komplette Song-Objekte (mit allen Feldern) aus der DB, nur um die IDs zu bekommen. Bei 1000 Songs werden 1000 `Song.fromMap()`-Aufrufe gemacht.
|
||||||
|
|
||||||
|
**Fix:** Dedizierte DB-Query:
|
||||||
|
```dart
|
||||||
|
Future<Set<int>> favoritenIds() async {
|
||||||
|
final d = await _db.db;
|
||||||
|
final rows = await d.rawQuery(
|
||||||
|
'SELECT song_id FROM playlist_songs WHERE playlist_id = ?',
|
||||||
|
[_favoritenPlaylistId],
|
||||||
|
);
|
||||||
|
return rows.map((r) => r['song_id'] as int).toSet();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Überschüssiger Code (Ponytail-Prinzip)
|
||||||
|
|
||||||
|
### 🧹 [PONY-1] 4 redundante Zeilen im `_p` Getter
|
||||||
|
|
||||||
|
**Datei:** `services/player_service.dart` · Zeilen 16–25
|
||||||
|
|
||||||
|
```dart
|
||||||
|
AudioPlayer get _p {
|
||||||
|
if (_player == null) {
|
||||||
|
try {
|
||||||
|
_player = AudioPlayer();
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('AudioPlayer Init Fehler: $e');
|
||||||
|
_player = AudioPlayer(); // ← gleicher Code nochmal??
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _player!;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Der doppelte `AudioPlayer()`-Aufruf im catch-Block ist sinnlos. Wenn der erste fehlschlägt, schlägt der zweite auch fehl. Einfach:
|
||||||
|
```dart
|
||||||
|
AudioPlayer get _p => _player ??= AudioPlayer();
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🧹 [PONY-2] Beispiel-Songs + Tags aus home_screen.dart raus
|
||||||
|
|
||||||
|
**Datei:** `screens/home_screen.dart` · Zeilen 32–40, 52–67
|
||||||
|
|
||||||
|
Die `_beispielTags` (hardcoded) und die Beispiel-Song-Seeding (Zeilen 53–67) gehören nicht in den produktiven Screen. Das ist Dev-Code.
|
||||||
|
|
||||||
|
**Fix:** Entweder in einen `DevDataSeeder()` auslagern oder per `--dart-define` steuern.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🧹 [PONY-3] Download-Dialog als StatefulBuilder im HomeScreen
|
||||||
|
|
||||||
|
**Datei:** `screens/home_screen.dart` · Zeilen 183–245
|
||||||
|
|
||||||
|
Der komplette Download-Dialog mit Timer-Polling ist im HomeScreen vergraben. Das sind ~60 Zeilen UI + Logik.
|
||||||
|
|
||||||
|
**Fix:** Eigene Widget-Datei `widgets/download_dialog.dart` mit `state`-haltendem Widget, das den Timer managed.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🧹 [PONY-4] `_header()` + `_statistik()` + `_tagLeiste()` → eigene Widgets
|
||||||
|
|
||||||
|
**Datei:** `screens/home_screen.dart` · Zeilen 280–393
|
||||||
|
|
||||||
|
Diese drei Methoden sind alle UI-only und könnten als eigene Widgets in `widgets/` leben.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Security & Robustheit
|
||||||
|
|
||||||
|
### 🔒 [SEC-1] `Permission.storage` ist auf Android 33+ deprecated
|
||||||
|
|
||||||
|
**Datei:** `services/musik_scanner.dart` · Zeile 19
|
||||||
|
|
||||||
|
```dart
|
||||||
|
final status = await Permission.storage.request();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Ab API 33 (Android 13) gibt es `READ_MEDIA_AUDIO` statt `READ_EXTERNAL_STORAGE`. `Permission.storage` fragt nach der alten Permission, die auf neueren Geräten ignoriert wird.
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
```dart
|
||||||
|
import 'dart:io' show Platform;
|
||||||
|
// Oder besser über permission_handler Android-specific
|
||||||
|
await Permission.audio.request();
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🔒 [SEC-2] Kein Retry-Mechanismus bei Netzwerkfehlern
|
||||||
|
|
||||||
|
**Datei:** `services/download_service.dart` · Zeilen 32–131
|
||||||
|
|
||||||
|
Bei Timeout oder Verbindungsabbruch wird einfach `null` zurückgegeben. Kein Retry, kein exponentielles Backoff.
|
||||||
|
|
||||||
|
**Fix:** 2-3 Retry-Versuche mit steigendem Timeout:
|
||||||
|
```dart
|
||||||
|
for (int versuch = 0; versuch < 3; versuch++) {
|
||||||
|
try {
|
||||||
|
return await _downloadAttempt(url);
|
||||||
|
} catch (e) {
|
||||||
|
if (versuch == 2) rethrow;
|
||||||
|
await Future.delayed(Duration(seconds: 2 * (versuch + 1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🔒 [SEC-3] Kein Cancel-Mechanismus beim YouTube-Download
|
||||||
|
|
||||||
|
**Datei:** `services/download_service.dart` · Zeilen 90–108
|
||||||
|
|
||||||
|
Einmal gestartet, kann der Download nicht abgebrochen werden. Der Nutzer muss warten oder die App killen.
|
||||||
|
|
||||||
|
**Fix:** `StreamSubscription` speichern und `cancel()` anbieten:
|
||||||
|
```dart
|
||||||
|
StreamSubscription? _downloadSub;
|
||||||
|
void cancelDownload() => _downloadSub?.cancel();
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Missing Features
|
||||||
|
|
||||||
|
### 📌 [FEAT-1] **4 von 5 Bottom-Nav-Tabs sind leer**
|
||||||
|
|
||||||
|
`home_screen.dart` Zeilen 509–515: Navigation hat 5 Einträge, aber keine `_selectedIndex` und keine `IndexedStack` oder `switch`-Logik. Alle Tabs außer "Musik" zeigen denselben Screen.
|
||||||
|
|
||||||
|
**Zu implementieren:**
|
||||||
|
- `Downloads` → Zeige heruntergeladene Songs + Download-Buttons
|
||||||
|
- `Tags` → Tag-Verwaltung (erstellen, löschen, Songs zuweisen)
|
||||||
|
- `Favoriten` → Zeige Favoriten-Playlist
|
||||||
|
- `Einstellungen` → Theme, Cache, Info
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 📌 [FEAT-2] **Keine Audio-Service Integration**
|
||||||
|
|
||||||
|
`audio_service: ^0.18.15` ist als Dependency eingetragen, aber wird nirgends importiert oder verwendet. `PlayerService` ist standalone ohne Background-Playback.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 📌 [FEAT-3] **`setWarteschlange` ohne Automatische Wiedergabe**
|
||||||
|
|
||||||
|
`player_service.dart` Zeilen 83–87: Die Warteschlange wird gesetzt, aber nach dem letzten Song stoppt die Wiedergabe (kein Loop, kein Shuffle, keine Queue-Weiterverarbeitung).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Zusammenfassung: Priority-TODO-Liste
|
||||||
|
|
||||||
|
### 🔴 MUST FIX (sofort — vor Release)
|
||||||
|
|
||||||
|
| # | Datei | Zeile | Issue |
|
||||||
|
|---|-------|-------|-------|
|
||||||
|
| 1 | `widgets/mini_player.dart` | 20-32 | **Memory Leak:** Streams nie gecancelled |
|
||||||
|
| 2 | `widgets/metadaten_dialog.dart` | 88 | **Null-Crash:** `song.id!` kann crashen |
|
||||||
|
| 3 | `services/musik_scanner.dart` | 38 | **`dauerSekunden: 0`** — alle Songs haben Dauer 0 |
|
||||||
|
| 4 | `database/db_helper.dart` | 126-135 | **DB-Flut:** positionAktualisieren inserted immer neu |
|
||||||
|
| 5 | `main.dart` | 48-62 | **`FlutterErrorBoundary`** tut nichts (entfernen oder fixen) |
|
||||||
|
| 6 | `widgets/mini_player.dart` | 131 | **Kein `dispose()`** — Leak #2 |
|
||||||
|
|
||||||
|
### 🟠 SHOULD FIX (nächster Sprint)
|
||||||
|
|
||||||
|
| # | Datei | Zeile | Issue |
|
||||||
|
|---|-------|-------|-------|
|
||||||
|
| 7 | `services/download_service.dart` | 56,75,105,127 | Fehlermeldungen abgeschnitten (substring) |
|
||||||
|
| 8 | `services/musik_scanner.dart` | 121-126 | `_scanneViaMediaStore()` gibt `[]` zurück |
|
||||||
|
| 9 | `main.dart` | 34-46 | `AppWrapper` totes Gewebe (entfernen) |
|
||||||
|
| 10 | `screens/home_screen.dart` | 382 | Tag-Filter tut nichts |
|
||||||
|
| 11 | `screens/home_screen.dart` | 32-40 | Hardcoded Beispiel-Tags (aus DB laden!) |
|
||||||
|
| 12 | `services/download_service.dart` | 90-108 | Kein Cancel-Mechanismus |
|
||||||
|
| 13 | `services/download_service.dart` | — | Kein Retry bei Netzwerkfehlern |
|
||||||
|
| 14 | `services/musik_scanner.dart` | 19-20 | Permission.storage deprecated (API 33+) |
|
||||||
|
| 15 | `screens/home_screen.dart` | 509-515 | 4/5 Bottom-Nav-Tabs leer |
|
||||||
|
| 16 | `services/favoriten_service.dart` | 45-49 | `favoritenIds()` lädt unnötig alle Songs |
|
||||||
|
|
||||||
|
### 🟡 NICE TO IMPROVE (Code-Qualität)
|
||||||
|
|
||||||
|
| # | Datei | Zeile | Issue |
|
||||||
|
|---|-------|-------|-------|
|
||||||
|
| 17 | `screens/home_screen.dart` | 1-519 | **Monolith** — in Einzeldateien aufteilen |
|
||||||
|
| 18 | `services/player_service.dart` | 16-25 | Redundanter try-catch im `_p` Getter |
|
||||||
|
| 19 | `database/db_helper.dart` | 221-229 | `loeschen()` ohne Transaktion |
|
||||||
|
| 20 | `services/musik_scanner.dart` | 29-65 | Doppelter try-catch Block |
|
||||||
|
| 21 | — | — | **Singleton-Overkill** → Dependency Injection |
|
||||||
|
| 22 | `screens/home_screen.dart` | 183-245 | Download-Dialog im HomeScreen (auslagern) |
|
||||||
|
| 23 | `services/player_service.dart` | 83-87 | setWarteschlange ohne Weiterschaltung |
|
||||||
|
| 24 | — | — | `audio_service` nie verwendet (Background-Playback) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Statistik
|
||||||
|
|
||||||
|
| Metrik | Wert |
|
||||||
|
|--------|------|
|
||||||
|
| **Dateien** | 11 (12 mit pubspec.yaml) |
|
||||||
|
| **Gesamt-LOC (Dart)** | 1.613 |
|
||||||
|
| **Größte Datei** | `home_screen.dart` — 519 Zeilen (32%) |
|
||||||
|
| **Singleton-Klassen** | 5/6 (83%) |
|
||||||
|
| **Kritische Bugs** | **6** |
|
||||||
|
| **Schwere Probleme** | **6** |
|
||||||
|
| **Code-Qualität** | **5** |
|
||||||
|
| **Ponytail-Verletzungen** | **4** (→ extrahieren) |
|
||||||
|
| **Security** | **3** |
|
||||||
|
| **Fehlende Features** | **4** (davon 1 komplett leer) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
> **Fazit:** Die App hat ein solides Grundgerüst, aber leidet unter klassischen "Solo-Dev"-Problemen: Memory Leaks, Null-Safety-Lücken, Singleton-Overkill und ein Monolith-Screen. Der größte Hebel ist die Aufteilung von `home_screen.dart` (→ 3-4 eigene Widgets) und das Fixen der 6 kritischen Bugs. Danach: MediaStore-Integration für echte Song-Dauer und die 4 leeren Tabs befüllen.
|
||||||
|
|
||||||
|
> "Weniger Code, mehr Wirkung" — **Ponytail-Prinzip.** Der MiniPlayer könnte mit dispose-Fix und gekürztem Code locker 30 Zeilen verlieren. Der HomeScreen sollte bei ~250 Zeilen landen.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# melo_app
|
||||||
|
|
||||||
|
A new Flutter project.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
This project is a starting point for a Flutter application.
|
||||||
|
|
||||||
|
A few resources to get you started if this is your first Flutter project:
|
||||||
|
|
||||||
|
- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter)
|
||||||
|
- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||||
|
- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources)
|
||||||
|
|
||||||
|
For help getting started with Flutter development, view the
|
||||||
|
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||||
|
samples, guidance on mobile development, and a full API reference.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to
|
||||||
|
# check for errors, warnings, and lints.
|
||||||
|
#
|
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||||
|
# invoked from the command line by running `flutter analyze`.
|
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
# The lint rules applied to this project can be customized in the
|
||||||
|
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||||
|
# included above or to enable additional rules. A list of all available lints
|
||||||
|
# and their documentation is published at https://dart.dev/lints.
|
||||||
|
#
|
||||||
|
# Instead of disabling a lint rule for the entire project in the
|
||||||
|
# section below, it can also be suppressed for a single line of code
|
||||||
|
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||||
|
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||||
|
# producing the lint.
|
||||||
|
rules:
|
||||||
|
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||||
|
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||||
|
|
||||||
|
# Additional information about this file can be found at
|
||||||
|
# https://dart.dev/guides/language/analysis-options
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
gradle-wrapper.jar
|
||||||
|
/.gradle
|
||||||
|
/captures/
|
||||||
|
/gradlew
|
||||||
|
/gradlew.bat
|
||||||
|
/local.properties
|
||||||
|
GeneratedPluginRegistrant.java
|
||||||
|
.cxx/
|
||||||
|
|
||||||
|
# Remember to never publicly share your keystore.
|
||||||
|
# See https://flutter.dev/to/reference-keystore
|
||||||
|
key.properties
|
||||||
|
**/*.keystore
|
||||||
|
**/*.jks
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
plugins {
|
||||||
|
id("com.android.application")
|
||||||
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||||
|
id("dev.flutter.flutter-gradle-plugin")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "com.melo.melo_app"
|
||||||
|
compileSdk = flutter.compileSdkVersion
|
||||||
|
ndkVersion = flutter.ndkVersion
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
|
applicationId = "com.melo.melo_app"
|
||||||
|
// You can update the following values to match your application needs.
|
||||||
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||||
|
minSdk = flutter.minSdkVersion
|
||||||
|
targetSdk = flutter.targetSdkVersion
|
||||||
|
versionCode = flutter.versionCode
|
||||||
|
versionName = flutter.versionName
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
// TODO: Add your own signing config for the release build.
|
||||||
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||||
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flutter {
|
||||||
|
source = "../.."
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
the Flutter tool needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||||
|
<application
|
||||||
|
android:label="Melo"
|
||||||
|
android:name="${applicationName}"
|
||||||
|
android:icon="@mipmap/ic_launcher">
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:taskAffinity=""
|
||||||
|
android:theme="@style/LaunchTheme"
|
||||||
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
|
the Android process has started. This theme is visible to the user
|
||||||
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
|
to determine the Window background behind the Flutter UI. -->
|
||||||
|
<meta-data
|
||||||
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
|
android:resource="@style/NormalTheme"
|
||||||
|
/>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<!-- Don't delete the meta-data below.
|
||||||
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
<meta-data
|
||||||
|
android:name="flutterEmbedding"
|
||||||
|
android:value="2" />
|
||||||
|
</application>
|
||||||
|
<!-- Required to query activities that can process text, see:
|
||||||
|
https://developer.android.com/training/package-visibility and
|
||||||
|
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||||
|
|
||||||
|
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||||
|
<queries>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||||
|
<data android:mimeType="text/plain"/>
|
||||||
|
</intent>
|
||||||
|
</queries>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.melo.melo_app
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
class MainActivity : FlutterActivity()
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="?android:colorBackground" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@android:color/white" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
||||||
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 721 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
the Flutter engine draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
the Flutter engine draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
the Flutter tool needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val newBuildDir: Directory =
|
||||||
|
rootProject.layout.buildDirectory
|
||||||
|
.dir("../../build")
|
||||||
|
.get()
|
||||||
|
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||||
|
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||||
|
}
|
||||||
|
subprojects {
|
||||||
|
project.evaluationDependsOn(":app")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register<Delete>("clean") {
|
||||||
|
delete(rootProject.layout.buildDirectory)
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||||
|
android.useAndroidX=true
|
||||||
|
# This newDsl flag was added by the Flutter template
|
||||||
|
android.newDsl=false
|
||||||
|
# This builtInKotlin flag was added by the Flutter template
|
||||||
|
android.builtInKotlin=false
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
pluginManagement {
|
||||||
|
val flutterSdkPath =
|
||||||
|
run {
|
||||||
|
val properties = java.util.Properties()
|
||||||
|
file("local.properties").inputStream().use { properties.load(it) }
|
||||||
|
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||||
|
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||||
|
flutterSdkPath
|
||||||
|
}
|
||||||
|
|
||||||
|
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||||
|
id("com.android.application") version "9.0.1" apply false
|
||||||
|
id("org.jetbrains.kotlin.android") version "2.3.20" apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
include(":app")
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
vision:
|
||||||
|
provider: google
|
||||||
|
model: gemini-2.5-flash
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
**/dgph
|
||||||
|
*.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
*.moved-aside
|
||||||
|
*.pbxuser
|
||||||
|
*.perspectivev3
|
||||||
|
**/*sync/
|
||||||
|
.sconsign.dblite
|
||||||
|
.tags*
|
||||||
|
**/.vagrant/
|
||||||
|
**/DerivedData/
|
||||||
|
Icon?
|
||||||
|
**/Pods/
|
||||||
|
**/.symlinks/
|
||||||
|
profile
|
||||||
|
xcuserdata
|
||||||
|
**/.generated/
|
||||||
|
Flutter/App.framework
|
||||||
|
Flutter/Flutter.framework
|
||||||
|
Flutter/Flutter.podspec
|
||||||
|
Flutter/Generated.xcconfig
|
||||||
|
Flutter/ephemeral/
|
||||||
|
Flutter/app.flx
|
||||||
|
Flutter/app.zip
|
||||||
|
Flutter/flutter_assets/
|
||||||
|
Flutter/flutter_export_environment.sh
|
||||||
|
ServiceDefinitions.json
|
||||||
|
Runner/GeneratedPluginRegistrant.*
|
||||||
|
|
||||||
|
# Exceptions to above rules.
|
||||||
|
!default.mode1v3
|
||||||
|
!default.mode2v3
|
||||||
|
!default.pbxuser
|
||||||
|
!default.perspectivev3
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>io.flutter.flutter.app</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
|
#include "Generated.xcconfig"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
|
#include "Generated.xcconfig"
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# Uncomment this line to define a global platform for your project
|
||||||
|
# platform :ios, '13.0'
|
||||||
|
|
||||||
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
|
||||||
|
project 'Runner', {
|
||||||
|
'Debug' => :debug,
|
||||||
|
'Profile' => :release,
|
||||||
|
'Release' => :release,
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutter_root
|
||||||
|
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
||||||
|
unless File.exist?(generated_xcode_build_settings_path)
|
||||||
|
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||||
|
end
|
||||||
|
|
||||||
|
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||||
|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||||
|
return matches[1].strip if matches
|
||||||
|
end
|
||||||
|
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
||||||
|
end
|
||||||
|
|
||||||
|
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||||
|
|
||||||
|
flutter_ios_podfile_setup
|
||||||
|
|
||||||
|
target 'Runner' do
|
||||||
|
use_frameworks!
|
||||||
|
|
||||||
|
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||||
|
target 'RunnerTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
installer.pods_project.targets.each do |target|
|
||||||
|
flutter_additional_ios_build_settings(target)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,644 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 54;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
|
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; };
|
||||||
|
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
|
||||||
|
remoteInfo = Runner;
|
||||||
|
};
|
||||||
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
name = "Embed Frameworks";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Flutter;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146E51CF9000F007C117D = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */,
|
||||||
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146EF1CF9000F007C117D /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||||
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146F01CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */,
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||||
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||||
|
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */,
|
||||||
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||||
|
);
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
331C8080294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
331C807D294A63A400263BE5 /* Sources */,
|
||||||
|
331C807F294A63A400263BE5 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
331C8086294A63A400263BE5 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = RunnerTests;
|
||||||
|
productName = RunnerTests;
|
||||||
|
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
|
buildPhases = (
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Runner;
|
||||||
|
packageProductDependencies = (
|
||||||
|
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
|
||||||
|
);
|
||||||
|
productName = Runner;
|
||||||
|
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = YES;
|
||||||
|
LastUpgradeCheck = 1510;
|
||||||
|
ORGANIZATIONNAME = "";
|
||||||
|
TargetAttributes = {
|
||||||
|
331C8080294A63A400263BE5 = {
|
||||||
|
CreatedOnToolsVersion = 14.0;
|
||||||
|
TestTargetID = 97C146ED1CF9000F007C117D;
|
||||||
|
};
|
||||||
|
97C146ED1CF9000F007C117D = {
|
||||||
|
CreatedOnToolsVersion = 7.3.1;
|
||||||
|
LastSwiftMigration = 1100;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 97C146E51CF9000F007C117D;
|
||||||
|
packageReferences = (
|
||||||
|
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
|
||||||
|
);
|
||||||
|
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */,
|
||||||
|
331C8080294A63A400263BE5 /* RunnerTests */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
331C807F294A63A400263BE5 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||||
|
);
|
||||||
|
name = "Thin Binary";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
|
};
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Run Script";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
331C807D294A63A400263BE5 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||||
|
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXTargetDependency section */
|
||||||
|
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 97C146ED1CF9000F007C117D /* Runner */;
|
||||||
|
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C146FB1CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = Main.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C147001CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = LaunchScreen.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.melo.meloApp;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
331C8088294A63A400263BE5 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.melo.meloApp.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
331C8089294A63A400263BE5 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.melo.meloApp.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
331C808A294A63A400263BE5 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.melo.meloApp.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
97C147031CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147041CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
97C147061CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.melo.meloApp;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147071CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.melo.meloApp;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
331C8088294A63A400263BE5 /* Debug */,
|
||||||
|
331C8089294A63A400263BE5 /* Release */,
|
||||||
|
331C808A294A63A400263BE5 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147031CF9000F007C117D /* Debug */,
|
||||||
|
97C147041CF9000F007C117D /* Release */,
|
||||||
|
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147061CF9000F007C117D /* Debug */,
|
||||||
|
97C147071CF9000F007C117D /* Release */,
|
||||||
|
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
|
/* Begin XCLocalSwiftPackageReference section */
|
||||||
|
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
|
||||||
|
isa = XCLocalSwiftPackageReference;
|
||||||
|
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
|
||||||
|
};
|
||||||
|
/* End XCLocalSwiftPackageReference section */
|
||||||
|
|
||||||
|
/* Begin XCSwiftPackageProductDependency section */
|
||||||
|
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
|
||||||
|
isa = XCSwiftPackageProductDependency;
|
||||||
|
productName = FlutterGeneratedPluginSwiftPackage;
|
||||||
|
};
|
||||||
|
/* End XCSwiftPackageProductDependency section */
|
||||||
|
};
|
||||||
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1510"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<PreActions>
|
||||||
|
<ExecutionAction
|
||||||
|
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
||||||
|
<ActionContent
|
||||||
|
title = "Run Prepare Flutter Framework Script"
|
||||||
|
scriptText = "/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" prepare ">
|
||||||
|
<EnvironmentBuildable>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</EnvironmentBuildable>
|
||||||
|
</ActionContent>
|
||||||
|
</ExecutionAction>
|
||||||
|
</PreActions>
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||||
|
BuildableName = "RunnerTests.xctest"
|
||||||
|
BlueprintName = "RunnerTests"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
enableGPUValidationMode = "1"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Profile"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:Runner.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
@main
|
||||||
|
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
||||||
|
override func application(
|
||||||
|
_ application: UIApplication,
|
||||||
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
|
) -> Bool {
|
||||||
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
||||||
|
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "83.5x83.5",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "1024x1024",
|
||||||
|
"idiom" : "ios-marketing",
|
||||||
|
"filename" : "Icon-App-1024x1024@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 282 B |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 586 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 762 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
@@ -0,0 +1,5 @@
|
|||||||
|
# Launch Screen Assets
|
||||||
|
|
||||||
|
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||||
|
|
||||||
|
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="EHf-IW-A2E">
|
||||||
|
<objects>
|
||||||
|
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||||
|
</imageView>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||||
|
</constraints>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="53" y="375"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<resources>
|
||||||
|
<image name="LaunchImage" width="168" height="185"/>
|
||||||
|
</resources>
|
||||||
|
</document>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--Flutter View Controller-->
|
||||||
|
<scene sceneID="tne-QT-ifu">
|
||||||
|
<objects>
|
||||||
|
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
|
<true/>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>Melo App</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>melo_app</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIApplicationSceneManifest</key>
|
||||||
|
<dict>
|
||||||
|
<key>UIApplicationSupportsMultipleScenes</key>
|
||||||
|
<false/>
|
||||||
|
<key>UISceneConfigurations</key>
|
||||||
|
<dict>
|
||||||
|
<key>UIWindowSceneSessionRoleApplication</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>UISceneClassName</key>
|
||||||
|
<string>UIWindowScene</string>
|
||||||
|
<key>UISceneConfigurationName</key>
|
||||||
|
<string>flutter</string>
|
||||||
|
<key>UISceneDelegateClassName</key>
|
||||||
|
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||||
|
<key>UISceneStoryboardFile</key>
|
||||||
|
<string>Main</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
|
<true/>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIMainStoryboardFile</key>
|
||||||
|
<string>Main</string>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#import "GeneratedPluginRegistrant.h"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
class SceneDelegate: FlutterSceneDelegate {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
class RunnerTests: XCTestCase {
|
||||||
|
|
||||||
|
func testExample() {
|
||||||
|
// If you add code to the Runner application, consider adding tests here.
|
||||||
|
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
|
import '../models/song.dart';
|
||||||
|
import '../models/tag.dart';
|
||||||
|
|
||||||
|
class DbHelper {
|
||||||
|
static final DbHelper _instanz = DbHelper._();
|
||||||
|
factory DbHelper() => _instanz;
|
||||||
|
DbHelper._();
|
||||||
|
|
||||||
|
Database? _db;
|
||||||
|
|
||||||
|
Future<Database> get db async {
|
||||||
|
if (_db != null) return _db!;
|
||||||
|
_db = await _init();
|
||||||
|
return _db!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Database> _init() async {
|
||||||
|
final pfad = await getDatabasesPath();
|
||||||
|
return openDatabase(
|
||||||
|
p.join(pfad, 'melo.db'),
|
||||||
|
version: 1,
|
||||||
|
onCreate: (db, version) async {
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE songs (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
titel TEXT NOT NULL,
|
||||||
|
kuenstler TEXT NOT NULL,
|
||||||
|
album TEXT DEFAULT '',
|
||||||
|
dauer_sekunden INTEGER NOT NULL,
|
||||||
|
datei_pfad TEXT NOT NULL UNIQUE,
|
||||||
|
cover_pfad TEXT,
|
||||||
|
groesse_bytes INTEGER DEFAULT 0,
|
||||||
|
ist_heruntergeladen INTEGER DEFAULT 0,
|
||||||
|
hinzugefuegt_am TEXT NOT NULL,
|
||||||
|
download_quelle TEXT DEFAULT 'local',
|
||||||
|
zuletzt_position INTEGER
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE tags (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
name TEXT NOT NULL UNIQUE,
|
||||||
|
icon TEXT,
|
||||||
|
farbe_hex TEXT
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE song_tags (
|
||||||
|
song_id INTEGER NOT NULL,
|
||||||
|
tag_id INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (song_id, tag_id),
|
||||||
|
FOREIGN KEY (song_id) REFERENCES songs(id) ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE playlists (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
erstellt_am TEXT NOT NULL
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE playlist_songs (
|
||||||
|
playlist_id INTEGER NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL,
|
||||||
|
position INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (playlist_id, song_id),
|
||||||
|
FOREIGN KEY (playlist_id) REFERENCES playlists(id) ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (song_id) REFERENCES songs(id) ON DELETE CASCADE
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE wiedergabe_verlauf (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
song_id INTEGER NOT NULL,
|
||||||
|
position INTEGER DEFAULT 0,
|
||||||
|
zuletzt_abgespielt TEXT NOT NULL,
|
||||||
|
FOREIGN KEY (song_id) REFERENCES songs(id) ON DELETE CASCADE
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Songs ──────────────────────────────────────
|
||||||
|
|
||||||
|
Future<int> songEinfuegen(Song song) async {
|
||||||
|
final d = await db;
|
||||||
|
return d.insert('songs', song.toMap(),
|
||||||
|
conflictAlgorithm: ConflictAlgorithm.ignore);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> songsEinfuegen(List<Song> songs) async {
|
||||||
|
final d = await db;
|
||||||
|
final batch = d.batch();
|
||||||
|
for (final song in songs) {
|
||||||
|
batch.insert('songs', song.toMap(),
|
||||||
|
conflictAlgorithm: ConflictAlgorithm.ignore);
|
||||||
|
}
|
||||||
|
await batch.commit(noResult: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Song>> alleSongs() async {
|
||||||
|
final d = await db;
|
||||||
|
final rows = await d.query('songs', orderBy: 'hinzugefuegt_am DESC');
|
||||||
|
return rows.map((r) => Song.fromMap(r)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Song?> songNachId(int id) async {
|
||||||
|
final d = await db;
|
||||||
|
final rows = await d.query('songs', where: 'id = ?', whereArgs: [id]);
|
||||||
|
if (rows.isEmpty) return null;
|
||||||
|
return Song.fromMap(rows.first);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Song?> songNachPfad(String pfad) async {
|
||||||
|
final d = await db;
|
||||||
|
final rows = await d.query('songs', where: 'datei_pfad = ?', whereArgs: [pfad]);
|
||||||
|
if (rows.isEmpty) return null;
|
||||||
|
return Song.fromMap(rows.first);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> positionAktualisieren(int songId, int position) async {
|
||||||
|
final d = await db;
|
||||||
|
await d.update('songs', {'zuletzt_position': position},
|
||||||
|
where: 'id = ?', whereArgs: [songId]);
|
||||||
|
final rows = await d.update('wiedergabe_verlauf',
|
||||||
|
{'position': position, 'zuletzt_abgespielt': DateTime.now().toIso8601String()},
|
||||||
|
where: 'song_id = ?', whereArgs: [songId]);
|
||||||
|
if (rows == 0) {
|
||||||
|
await d.insert('wiedergabe_verlauf', {
|
||||||
|
'song_id': songId,
|
||||||
|
'position': position,
|
||||||
|
'zuletzt_abgespielt': DateTime.now().toIso8601String(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Tags ────────────────────────────────────────
|
||||||
|
|
||||||
|
Future<int> tagErstellen(String name, {String? icon, String? farbe}) async {
|
||||||
|
final d = await db;
|
||||||
|
return d.insert('tags', {
|
||||||
|
'name': name, 'icon': icon, 'farbe_hex': farbe,
|
||||||
|
}, conflictAlgorithm: ConflictAlgorithm.ignore);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Tag>> alleTags() async {
|
||||||
|
final d = await db;
|
||||||
|
final rows = await d.query('tags', orderBy: 'name');
|
||||||
|
return rows.map((r) => Tag.fromMap(r)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> songTagHinzufuegen(int songId, int tagId) async {
|
||||||
|
final d = await db;
|
||||||
|
await d.insert('song_tags', {'song_id': songId, 'tag_id': tagId},
|
||||||
|
conflictAlgorithm: ConflictAlgorithm.ignore);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Tag>> tagsFuerSong(int songId) async {
|
||||||
|
final d = await db;
|
||||||
|
final rows = await d.rawQuery('''
|
||||||
|
SELECT t.* FROM tags t
|
||||||
|
JOIN song_tags st ON t.id = st.tag_id
|
||||||
|
WHERE st.song_id = ?
|
||||||
|
''', [songId]);
|
||||||
|
return rows.map((r) => Tag.fromMap(r)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Playlists ───────────────────────────────────
|
||||||
|
|
||||||
|
Future<int> playlistErstellen(String name) async {
|
||||||
|
final d = await db;
|
||||||
|
return d.insert('playlists', {
|
||||||
|
'name': name,
|
||||||
|
'erstellt_am': DateTime.now().toIso8601String(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> songZurPlaylist(int playlistId, int songId, int position) async {
|
||||||
|
final d = await db;
|
||||||
|
await d.insert('playlist_songs', {
|
||||||
|
'playlist_id': playlistId,
|
||||||
|
'song_id': songId,
|
||||||
|
'position': position,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Map<String, dynamic>>> allePlaylists() async {
|
||||||
|
final d = await db;
|
||||||
|
return d.query('playlists', orderBy: 'erstellt_am DESC');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> songAusPlaylistEntfernen(int playlistId, int songId) async {
|
||||||
|
final d = await db;
|
||||||
|
await d.delete('playlist_songs',
|
||||||
|
where: 'playlist_id = ? AND song_id = ?',
|
||||||
|
whereArgs: [playlistId, songId]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> metadatenAktualisieren(int songId, {String? titel, String? kuenstler, String? album}) async {
|
||||||
|
final d = await db;
|
||||||
|
final update = <String, dynamic>{};
|
||||||
|
if (titel != null) update['titel'] = titel;
|
||||||
|
if (kuenstler != null) update['kuenstler'] = kuenstler;
|
||||||
|
if (album != null) update['album'] = album;
|
||||||
|
if (update.isNotEmpty) {
|
||||||
|
await d.update('songs', update, where: 'id = ?', whereArgs: [songId]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Song>> songsDerPlaylist(int playlistId) async {
|
||||||
|
final d = await db;
|
||||||
|
final rows = await d.rawQuery('''
|
||||||
|
SELECT s.* FROM songs s
|
||||||
|
JOIN playlist_songs ps ON s.id = ps.song_id
|
||||||
|
WHERE ps.playlist_id = ?
|
||||||
|
ORDER BY ps.position
|
||||||
|
''', [playlistId]);
|
||||||
|
return rows.map((r) => Song.fromMap(r)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> loeschen() async {
|
||||||
|
final d = await db;
|
||||||
|
await d.transaction((txn) async {
|
||||||
|
await txn.delete('wiedergabe_verlauf');
|
||||||
|
await txn.delete('song_tags');
|
||||||
|
await txn.delete('playlist_songs');
|
||||||
|
await txn.delete('playlists');
|
||||||
|
await txn.delete('tags');
|
||||||
|
await txn.delete('songs');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'database/db_helper.dart';
|
||||||
|
import 'services/favoriten_service.dart';
|
||||||
|
import 'utils/farb_theme.dart';
|
||||||
|
import 'screens/home_screen.dart';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await DbHelper().db;
|
||||||
|
await FavoritenService().init();
|
||||||
|
} catch (e, stack) {
|
||||||
|
debugPrint('Start-Fehler: $e\n$stack');
|
||||||
|
}
|
||||||
|
|
||||||
|
runApp(const MeloApp());
|
||||||
|
}
|
||||||
|
|
||||||
|
class MeloApp extends StatelessWidget {
|
||||||
|
const MeloApp({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
title: 'Melo',
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
theme: MeloTheme.theme,
|
||||||
|
home: const Scaffold(body: MeloHome()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
class Song {
|
||||||
|
final int? id;
|
||||||
|
final String titel;
|
||||||
|
final String kuenstler;
|
||||||
|
final String album;
|
||||||
|
final int dauerSekunden;
|
||||||
|
final String dateiPfad;
|
||||||
|
final String? coverPfad;
|
||||||
|
final int groesseBytes;
|
||||||
|
final bool istHeruntergeladen;
|
||||||
|
final String hinzugefuegtAm;
|
||||||
|
final String downloadQuelle; // "local", "youtube"
|
||||||
|
int? zuletztPosition; // Sekunden, für Wiederaufnahme
|
||||||
|
|
||||||
|
Song({
|
||||||
|
this.id,
|
||||||
|
required this.titel,
|
||||||
|
required this.kuenstler,
|
||||||
|
this.album = '',
|
||||||
|
required this.dauerSekunden,
|
||||||
|
required this.dateiPfad,
|
||||||
|
this.coverPfad,
|
||||||
|
this.groesseBytes = 0,
|
||||||
|
this.istHeruntergeladen = false,
|
||||||
|
String? hinzugefuegtAm,
|
||||||
|
this.downloadQuelle = 'local',
|
||||||
|
this.zuletztPosition,
|
||||||
|
}) : hinzugefuegtAm = hinzugefuegtAm ?? DateTime.now().toIso8601String();
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() => {
|
||||||
|
'id': id,
|
||||||
|
'titel': titel,
|
||||||
|
'kuenstler': kuenstler,
|
||||||
|
'album': album,
|
||||||
|
'dauer_sekunden': dauerSekunden,
|
||||||
|
'datei_pfad': dateiPfad,
|
||||||
|
'cover_pfad': coverPfad,
|
||||||
|
'groesse_bytes': groesseBytes,
|
||||||
|
'ist_heruntergeladen': istHeruntergeladen ? 1 : 0,
|
||||||
|
'hinzugefuegt_am': hinzugefuegtAm,
|
||||||
|
'download_quelle': downloadQuelle,
|
||||||
|
'zuletzt_position': zuletztPosition,
|
||||||
|
};
|
||||||
|
|
||||||
|
factory Song.fromMap(Map<String, dynamic> m) => Song(
|
||||||
|
id: m['id'] as int?,
|
||||||
|
titel: m['titel'] as String,
|
||||||
|
kuenstler: m['kuenstler'] as String,
|
||||||
|
album: m['album'] as String? ?? '',
|
||||||
|
dauerSekunden: m['dauer_sekunden'] as int,
|
||||||
|
dateiPfad: m['datei_pfad'] as String,
|
||||||
|
coverPfad: m['cover_pfad'] as String?,
|
||||||
|
groesseBytes: m['groesse_bytes'] as int? ?? 0,
|
||||||
|
istHeruntergeladen: (m['ist_heruntergeladen'] as int?) == 1,
|
||||||
|
hinzugefuegtAm: m['hinzugefuegt_am'] as String?,
|
||||||
|
downloadQuelle: m['download_quelle'] as String? ?? 'local',
|
||||||
|
zuletztPosition: m['zuletzt_position'] as int?,
|
||||||
|
);
|
||||||
|
|
||||||
|
String get dauerFormatiert {
|
||||||
|
final min = dauerSekunden ~/ 60;
|
||||||
|
final sek = dauerSekunden % 60;
|
||||||
|
return '$min:${sek.toString().padLeft(2, '0')}';
|
||||||
|
}
|
||||||
|
|
||||||
|
String get groesseFormatiert {
|
||||||
|
if (groesseBytes < 1048576) return '${(groesseBytes / 1024).toStringAsFixed(0)} KB';
|
||||||
|
return '${(groesseBytes / 1048576).toStringAsFixed(1)} MB';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
class Tag {
|
||||||
|
final int? id;
|
||||||
|
final String name;
|
||||||
|
final String? icon;
|
||||||
|
final String? farbeHex;
|
||||||
|
|
||||||
|
Tag({this.id, required this.name, this.icon, this.farbeHex});
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() => {
|
||||||
|
'id': id,
|
||||||
|
'name': name,
|
||||||
|
'icon': icon,
|
||||||
|
'farbe_hex': farbeHex,
|
||||||
|
};
|
||||||
|
|
||||||
|
factory Tag.fromMap(Map<String, dynamic> m) => Tag(
|
||||||
|
id: m['id'] as int?,
|
||||||
|
name: m['name'] as String,
|
||||||
|
icon: m['icon'] as String?,
|
||||||
|
farbeHex: m['farbe_hex'] as String?,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,392 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import '../database/db_helper.dart';
|
||||||
|
import '../services/player_service.dart';
|
||||||
|
import '../services/musik_scanner.dart';
|
||||||
|
import '../services/favoriten_service.dart';
|
||||||
|
import '../services/download_service.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
import '../widgets/mini_player.dart';
|
||||||
|
import '../widgets/melo_header.dart';
|
||||||
|
import '../widgets/statistik_card.dart';
|
||||||
|
import '../widgets/tag_leiste.dart';
|
||||||
|
import '../widgets/song_tile.dart';
|
||||||
|
|
||||||
|
class MeloHome extends StatefulWidget {
|
||||||
|
const MeloHome({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MeloHome> createState() => _MeloHomeState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MeloHomeState extends State<MeloHome> {
|
||||||
|
final PlayerService _player = PlayerService();
|
||||||
|
final DbHelper _db = DbHelper();
|
||||||
|
final FavoritenService _favoriten = FavoritenService();
|
||||||
|
final MusikScanner _scanner = MusikScanner();
|
||||||
|
final DownloadService _downloader = DownloadService();
|
||||||
|
|
||||||
|
List<Song> _songs = [];
|
||||||
|
String _aktiverTag = 'Alle';
|
||||||
|
bool _ladt = true;
|
||||||
|
Set<int> _favoritenIds = {};
|
||||||
|
|
||||||
|
final List<Map<String, String>> _beispielTags = [
|
||||||
|
{'name': 'Alle', 'icon': ''},
|
||||||
|
{'name': '❤️ Für uns', 'icon': '❤️'},
|
||||||
|
{'name': 'Nightcore', 'icon': '⚡'},
|
||||||
|
{'name': 'Traurig', 'icon': '😢'},
|
||||||
|
{'name': 'Party', 'icon': '🎉'},
|
||||||
|
{'name': 'Mitsingen', 'icon': '🎤'},
|
||||||
|
{'name': '2000er', 'icon': '📀'},
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_ladeSongs();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Song> get _gefilterteSongs {
|
||||||
|
if (_aktiverTag == 'Alle') return _songs;
|
||||||
|
return _songs.where((s) =>
|
||||||
|
s.titel.contains(_aktiverTag) ||
|
||||||
|
s.kuenstler.contains(_aktiverTag)
|
||||||
|
).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _ladeSongs() async {
|
||||||
|
setState(() => _ladt = true);
|
||||||
|
var songs = await _db.alleSongs();
|
||||||
|
|
||||||
|
if (songs.isEmpty) {
|
||||||
|
final beispiele = [
|
||||||
|
Song(titel: 'Leichtes Gepäck', kuenstler: 'Silbermond', album: 'Schritte',
|
||||||
|
dauerSekunden: 232, dateiPfad: '', groesseBytes: 5242880, istHeruntergeladen: true),
|
||||||
|
Song(titel: 'Auf uns', kuenstler: 'Andreas Bourani', album: 'Hey',
|
||||||
|
dauerSekunden: 241, dateiPfad: '', groesseBytes: 4819200, istHeruntergeladen: true),
|
||||||
|
Song(titel: '80 Millionen', kuenstler: 'Max Giesinger', album: 'Der Junge',
|
||||||
|
dauerSekunden: 225, dateiPfad: '', groesseBytes: 5107200, istHeruntergeladen: true),
|
||||||
|
Song(titel: 'Tage wie diese', kuenstler: 'Die Toten Hosen', album: 'Ballast',
|
||||||
|
dauerSekunden: 252, dateiPfad: '', groesseBytes: 4300800, istHeruntergeladen: true),
|
||||||
|
Song(titel: 'Atlantis', kuenstler: 'Frida Gold', album: 'Liebe',
|
||||||
|
dauerSekunden: 228, dateiPfad: '', groesseBytes: 3987200, istHeruntergeladen: true),
|
||||||
|
];
|
||||||
|
await _db.songsEinfuegen(beispiele);
|
||||||
|
songs = await _db.alleSongs();
|
||||||
|
}
|
||||||
|
|
||||||
|
final favoritenSet = await _favoriten.favoritenIds();
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
_songs = songs;
|
||||||
|
_favoritenIds = favoritenSet;
|
||||||
|
_ladt = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _zeigeSuche() async {
|
||||||
|
final controller = TextEditingController();
|
||||||
|
final ergebnis = await showDialog<String>(
|
||||||
|
context: context,
|
||||||
|
builder: (ctx) => AlertDialog(
|
||||||
|
backgroundColor: MeloTheme.dunkel1,
|
||||||
|
title: const Text('🔍 Song suchen', style: TextStyle(color: Colors.white, fontSize: 18)),
|
||||||
|
content: TextField(
|
||||||
|
controller: controller,
|
||||||
|
autofocus: true,
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
hintText: 'Titel oder Künstler...',
|
||||||
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(onPressed: () => Navigator.pop(ctx), child: const Text('Abbrechen')),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(ctx, controller.text),
|
||||||
|
child: const Text('Suchen', style: TextStyle(color: MeloTheme.rot)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (ergebnis == null || ergebnis.isEmpty) return;
|
||||||
|
final gefiltert = _songs.where((s) =>
|
||||||
|
s.titel.toLowerCase().contains(ergebnis.toLowerCase()) ||
|
||||||
|
s.kuenstler.toLowerCase().contains(ergebnis.toLowerCase())
|
||||||
|
).toList();
|
||||||
|
if (!mounted) return;
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (ctx) => AlertDialog(
|
||||||
|
backgroundColor: MeloTheme.dunkel1,
|
||||||
|
title: Text('🔍 ${gefiltert.length} Treffer', style: const TextStyle(color: Colors.white)),
|
||||||
|
content: SizedBox(
|
||||||
|
width: double.maxFinite,
|
||||||
|
height: 300,
|
||||||
|
child: gefiltert.isEmpty
|
||||||
|
? const Center(child: Text('Keine Treffer', style: TextStyle(color: Colors.grey)))
|
||||||
|
: ListView.builder(
|
||||||
|
itemCount: gefiltert.length,
|
||||||
|
itemBuilder: (_, i) => ListTile(
|
||||||
|
leading: Container(
|
||||||
|
width: 36, height: 36,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
gradient: const LinearGradient(colors: [Color(0xFF1A0000), Color(0xFF660000)]),
|
||||||
|
),
|
||||||
|
child: const Center(child: Text('♪', style: TextStyle(fontSize: 14, color: Colors.white54))),
|
||||||
|
),
|
||||||
|
title: Text(gefiltert[i].titel, style: const TextStyle(color: Colors.white)),
|
||||||
|
subtitle: Text(gefiltert[i].kuenstler, style: const TextStyle(color: Colors.grey)),
|
||||||
|
onTap: () { Navigator.pop(ctx); _spieleSong(gefiltert[i]); },
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [TextButton(onPressed: () => Navigator.pop(ctx), child: const Text('Schließen'))],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _scanMusik() async {
|
||||||
|
final erlaubt = await _scanner.frageSpeicherZugriff();
|
||||||
|
if (!erlaubt) {
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(content: Text('Bitte Speicherzugriff erlauben')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await _scanner.scanneMusikOrdner();
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: Text('Scannen fertig: ${_scanner.anzahlNeueSongs} neue Songs gefunden')),
|
||||||
|
);
|
||||||
|
await _ladeSongs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _zeigeDownloadDialog() async {
|
||||||
|
final controller = TextEditingController();
|
||||||
|
final url = await showDialog<String>(
|
||||||
|
context: context,
|
||||||
|
builder: (ctx) => AlertDialog(
|
||||||
|
backgroundColor: MeloTheme.dunkel1,
|
||||||
|
title: const Text('⬇ YouTube-Link einfügen', style: TextStyle(color: Colors.white)),
|
||||||
|
content: TextField(
|
||||||
|
controller: controller,
|
||||||
|
autofocus: true,
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
hintText: 'https://youtube.com/watch?v=...',
|
||||||
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(onPressed: () => Navigator.pop(ctx), child: const Text('Abbrechen')),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(ctx, controller.text),
|
||||||
|
child: const Text('Download', style: TextStyle(color: MeloTheme.rot)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (url == null || url.isEmpty) return;
|
||||||
|
if (!mounted) return;
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
|
builder: (ctx) {
|
||||||
|
Timer? timer;
|
||||||
|
return StatefulBuilder(
|
||||||
|
builder: (ctx, setDialogState) {
|
||||||
|
timer ??= Timer.periodic(const Duration(milliseconds: 200), (_) {
|
||||||
|
if (ctx.mounted) setDialogState(() {});
|
||||||
|
});
|
||||||
|
|
||||||
|
_downloader.downloadVonUrl(url).then((song) {
|
||||||
|
timer?.cancel();
|
||||||
|
if (song != null && ctx.mounted) {
|
||||||
|
setDialogState(() {});
|
||||||
|
Future.delayed(const Duration(milliseconds: 800), () {
|
||||||
|
if (ctx.mounted) Navigator.pop(ctx);
|
||||||
|
_ladeSongs();
|
||||||
|
});
|
||||||
|
} else if (ctx.mounted) {
|
||||||
|
Future.delayed(const Duration(seconds: 3), () {
|
||||||
|
if (ctx.mounted) Navigator.pop(ctx);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final fehler = _downloader.fehler;
|
||||||
|
final fortschritt = _downloader.fortschritt;
|
||||||
|
final statusText = fehler ?? _downloader.aktuellerTitel ?? 'Song wird heruntergeladen...';
|
||||||
|
|
||||||
|
return AlertDialog(
|
||||||
|
backgroundColor: MeloTheme.dunkel1,
|
||||||
|
title: const Text('⬇ Download', style: TextStyle(color: Colors.white)),
|
||||||
|
content: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
if (fehler == null)
|
||||||
|
LinearProgressIndicator(
|
||||||
|
value: fortschritt > 0 ? fortschritt : null,
|
||||||
|
color: MeloTheme.rot,
|
||||||
|
)
|
||||||
|
else
|
||||||
|
const Icon(Icons.error, color: Colors.red, size: 40),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(statusText,
|
||||||
|
style: TextStyle(fontSize: 13, color: fehler != null ? Colors.red : Colors.white70),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
if (fortschritt > 0) ...[
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text('${(fortschritt * 100).toStringAsFixed(0)}%',
|
||||||
|
style: const TextStyle(fontSize: 12, color: Colors.grey)),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _spieleSong(Song song) {
|
||||||
|
_player.setWarteschlange(_songs,
|
||||||
|
startIndex: _songs.indexWhere((s) => s.id == song.id));
|
||||||
|
_player.spiele(song);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _favoritenUmschalten(Song song) async {
|
||||||
|
if (song.id == null) return;
|
||||||
|
await _favoriten.umschalten(song.id!);
|
||||||
|
final aktuelleIds = await _favoriten.favoritenIds();
|
||||||
|
if (mounted) setState(() => _favoritenIds = aktuelleIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (_ladt) {
|
||||||
|
return const Scaffold(
|
||||||
|
backgroundColor: MeloTheme.schwarz,
|
||||||
|
body: Center(child: CircularProgressIndicator(color: MeloTheme.rot)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final gesamtMB = _songs.isEmpty ? '0'
|
||||||
|
: (_songs.fold(0, (int s, Song song) => s + song.groesseBytes) / 1048576).toStringAsFixed(0);
|
||||||
|
final gesamtMin = _songs.isEmpty ? 0
|
||||||
|
: (_songs.fold(0, (int s, Song song) => s + song.dauerSekunden) / 60).round();
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: MeloTheme.schwarz,
|
||||||
|
body: SafeArea(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
MeloHeader(onDownload: _zeigeDownloadDialog, onSearch: _zeigeSuche),
|
||||||
|
StatistikCard(
|
||||||
|
anzahlSongs: _songs.length,
|
||||||
|
gesamtMB: gesamtMB,
|
||||||
|
gesamtMin: gesamtMin,
|
||||||
|
anzahlFavoriten: _favoritenIds.length,
|
||||||
|
),
|
||||||
|
TagLeiste(
|
||||||
|
tags: _beispielTags,
|
||||||
|
aktiverTag: _aktiverTag,
|
||||||
|
onTagSelected: (tag) => setState(() => _aktiverTag = tag),
|
||||||
|
),
|
||||||
|
Expanded(child: _songListe()),
|
||||||
|
const MiniPlayer(),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomNavigationBar: _bottomNav(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _songListe() {
|
||||||
|
final songs = _gefilterteSongs;
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(20, 12, 20, 4),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text('📂 Alle Songs', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white)),
|
||||||
|
Row(children: [
|
||||||
|
Text('${songs.length} Titel${_aktiverTag != 'Alle' ? ' (gefiltert)' : ''}', style: TextStyle(fontSize: 12, color: MeloTheme.rot)),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: _scanMusik,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: MeloTheme.dunkel2),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.refresh, size: 12, color: MeloTheme.rot),
|
||||||
|
SizedBox(width: 4),
|
||||||
|
Text('Scannen', style: TextStyle(fontSize: 11, color: MeloTheme.rot)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
padding: const EdgeInsets.fromLTRB(20, 4, 20, 4),
|
||||||
|
itemCount: songs.length,
|
||||||
|
itemBuilder: (_, i) => SongTile(
|
||||||
|
song: songs[i],
|
||||||
|
istFavorit: songs[i].id != null && _favoritenIds.contains(songs[i].id),
|
||||||
|
onFavoriteToggle: _favoritenUmschalten,
|
||||||
|
onPlay: _spieleSong,
|
||||||
|
onMetadataChanged: _ladeSongs,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _bottomNav() {
|
||||||
|
return Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(top: BorderSide(color: MeloTheme.dunkel1)),
|
||||||
|
),
|
||||||
|
child: BottomNavigationBar(
|
||||||
|
type: BottomNavigationBarType.fixed,
|
||||||
|
backgroundColor: MeloTheme.schwarz,
|
||||||
|
selectedItemColor: MeloTheme.rot,
|
||||||
|
unselectedItemColor: MeloTheme.textSekundaer,
|
||||||
|
items: const [
|
||||||
|
BottomNavigationBarItem(icon: Icon(Icons.music_note, size: 22), label: 'Musik'),
|
||||||
|
BottomNavigationBarItem(icon: Icon(Icons.download, size: 22), label: 'Downloads'),
|
||||||
|
BottomNavigationBarItem(icon: Icon(Icons.label, size: 22), label: 'Tags'),
|
||||||
|
BottomNavigationBarItem(icon: Icon(Icons.favorite, size: 22), label: 'Favoriten'),
|
||||||
|
BottomNavigationBarItem(icon: Icon(Icons.settings, size: 22), label: 'Einstellungen'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
import '../database/db_helper.dart';
|
||||||
|
|
||||||
|
class DownloadService {
|
||||||
|
static final DownloadService _instanz = DownloadService._();
|
||||||
|
factory DownloadService() => _instanz;
|
||||||
|
DownloadService._();
|
||||||
|
|
||||||
|
final YoutubeExplode _yt = YoutubeExplode();
|
||||||
|
final DbHelper _db = DbHelper();
|
||||||
|
|
||||||
|
bool _ladt = false;
|
||||||
|
double _fortschritt = 0;
|
||||||
|
String? _aktuellerTitel;
|
||||||
|
String? _fehler;
|
||||||
|
|
||||||
|
bool get ladt => _ladt;
|
||||||
|
double get fortschritt => _fortschritt;
|
||||||
|
String? get aktuellerTitel => _aktuellerTitel;
|
||||||
|
String? get fehler => _fehler;
|
||||||
|
|
||||||
|
void _resetStatus() {
|
||||||
|
_ladt = true;
|
||||||
|
_fortschritt = 0;
|
||||||
|
_aktuellerTitel = null;
|
||||||
|
_fehler = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Song?> downloadVonUrl(String url) async {
|
||||||
|
_resetStatus();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// URL-Validierung
|
||||||
|
if (!url.contains('youtube.com') && !url.contains('youtu.be')) {
|
||||||
|
_fehler = 'Keine gültige YouTube-URL';
|
||||||
|
_ladt = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String titel = '';
|
||||||
|
String kuenstler = '';
|
||||||
|
int dauer = 0;
|
||||||
|
|
||||||
|
// Video-Info mit Timeout
|
||||||
|
_aktuellerTitel = 'YouTube wird kontaktiert...';
|
||||||
|
try {
|
||||||
|
final video = await _yt.videos.get(url).timeout(const Duration(seconds: 15));
|
||||||
|
titel = video.title;
|
||||||
|
kuenstler = video.author;
|
||||||
|
dauer = video.duration?.inSeconds ?? 0;
|
||||||
|
_aktuellerTitel = 'Video gefunden: $titel';
|
||||||
|
} catch (e) {
|
||||||
|
_fehler = 'Timeout/Fehler bei Video-Info: ${e.toString()}';
|
||||||
|
debugPrint('Video-Info Fehler (vollständig): $e');
|
||||||
|
_ladt = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Manifest abrufen
|
||||||
|
_aktuellerTitel = 'Audio-Stream wird ermittelt... (2/4)';
|
||||||
|
AudioStreamInfo? audio;
|
||||||
|
try {
|
||||||
|
final manifest = await _yt.videos.streamsClient
|
||||||
|
.getManifest(url).timeout(const Duration(seconds: 15));
|
||||||
|
final streams = manifest.audioOnly.toList();
|
||||||
|
if (streams.isEmpty) {
|
||||||
|
_fehler = 'Kein Audio-Stream verfügbar';
|
||||||
|
_ladt = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
audio = streams.reduce((a, b) => a.bitrate.bitsPerSecond > b.bitrate.bitsPerSecond ? a : b);
|
||||||
|
} catch (e) {
|
||||||
|
_fehler = 'Stream-Fehler: ${e.toString()}';
|
||||||
|
debugPrint('Stream Manifest Fehler (vollständig): $e');
|
||||||
|
_ladt = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zielpfad
|
||||||
|
_aktuellerTitel = 'Speicher wird vorbereitet... (3/4)';
|
||||||
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
|
final musikDir = Directory('${dir.path}/music');
|
||||||
|
if (!await musikDir.exists()) await musikDir.create(recursive: true);
|
||||||
|
final safeName = titel.replaceAll(RegExp(r'[^\w\s-]'), '').trim();
|
||||||
|
final dateiName = '${safeName.isEmpty ? "song" : safeName}.mp4';
|
||||||
|
final dateiPfad = '${musikDir.path}/$dateiName';
|
||||||
|
|
||||||
|
// Download
|
||||||
|
_aktuellerTitel = 'Lade herunter... (4/4)';
|
||||||
|
try {
|
||||||
|
final fileStream = _yt.videos.streamsClient.get(audio);
|
||||||
|
final file = File(dateiPfad);
|
||||||
|
final sink = file.openWrite();
|
||||||
|
int downloaded = 0;
|
||||||
|
final total = audio.size.totalBytes;
|
||||||
|
await for (final chunk in fileStream) {
|
||||||
|
sink.add(chunk);
|
||||||
|
downloaded += chunk.length;
|
||||||
|
_fortschritt = downloaded / total;
|
||||||
|
}
|
||||||
|
await sink.flush();
|
||||||
|
await sink.close();
|
||||||
|
} catch (e) {
|
||||||
|
_fehler = 'Download-Fehler: ${e.toString()}';
|
||||||
|
debugPrint('Download Stream Fehler (vollständig): $e');
|
||||||
|
_ladt = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Song speichern
|
||||||
|
final song = Song(
|
||||||
|
titel: titel,
|
||||||
|
kuenstler: kuenstler,
|
||||||
|
album: 'YouTube',
|
||||||
|
dauerSekunden: dauer,
|
||||||
|
dateiPfad: dateiPfad,
|
||||||
|
groesseBytes: await File(dateiPfad).length(),
|
||||||
|
istHeruntergeladen: true,
|
||||||
|
downloadQuelle: 'youtube',
|
||||||
|
);
|
||||||
|
await _db.songEinfuegen(song);
|
||||||
|
|
||||||
|
_ladt = false;
|
||||||
|
_aktuellerTitel = '✅ ${song.titel} heruntergeladen';
|
||||||
|
return song;
|
||||||
|
} catch (e) {
|
||||||
|
_fehler = 'Fehler: ${e.toString()}';
|
||||||
|
debugPrint('Download allgemeiner Fehler (vollständig): $e');
|
||||||
|
_ladt = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispose() {
|
||||||
|
_yt.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import '../database/db_helper.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
|
||||||
|
class FavoritenService {
|
||||||
|
static final FavoritenService _instanz = FavoritenService._();
|
||||||
|
factory FavoritenService() => _instanz;
|
||||||
|
FavoritenService._();
|
||||||
|
|
||||||
|
final DbHelper _db = DbHelper();
|
||||||
|
int? _favoritenPlaylistId;
|
||||||
|
|
||||||
|
int? get favoritenId => _favoritenPlaylistId;
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
final playlists = await _db.allePlaylists();
|
||||||
|
final vorhanden = playlists.where((p) => p['name'] == '⭐ Favoriten').toList();
|
||||||
|
if (vorhanden.isNotEmpty) {
|
||||||
|
_favoritenPlaylistId = vorhanden.first['id'] as int;
|
||||||
|
} else {
|
||||||
|
_favoritenPlaylistId = await _db.playlistErstellen('⭐ Favoriten');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> istFavorit(int songId) async {
|
||||||
|
if (_favoritenPlaylistId == null) return false;
|
||||||
|
final songs = await _db.songsDerPlaylist(_favoritenPlaylistId!);
|
||||||
|
return songs.any((s) => s.id == songId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> umschalten(int songId) async {
|
||||||
|
if (_favoritenPlaylistId == null) return;
|
||||||
|
if (await istFavorit(songId)) {
|
||||||
|
await _db.songAusPlaylistEntfernen(_favoritenPlaylistId!, songId);
|
||||||
|
} else {
|
||||||
|
final songs = await _db.songsDerPlaylist(_favoritenPlaylistId!);
|
||||||
|
await _db.songZurPlaylist(_favoritenPlaylistId!, songId, songs.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Song>> alleFavoriten() async {
|
||||||
|
if (_favoritenPlaylistId == null) return [];
|
||||||
|
return _db.songsDerPlaylist(_favoritenPlaylistId!);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Set<int>> favoritenIds() async {
|
||||||
|
if (_favoritenPlaylistId == null) return {};
|
||||||
|
final d = await _db.db;
|
||||||
|
final rows = await d.rawQuery(
|
||||||
|
'SELECT song_id FROM playlist_songs WHERE playlist_id = ?',
|
||||||
|
[_favoritenPlaylistId],
|
||||||
|
);
|
||||||
|
return rows.map((r) => r['song_id'] as int).toSet();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
import '../database/db_helper.dart';
|
||||||
|
|
||||||
|
class MusikScanner {
|
||||||
|
static final MusikScanner _instanz = MusikScanner._();
|
||||||
|
factory MusikScanner() => _instanz;
|
||||||
|
MusikScanner._();
|
||||||
|
|
||||||
|
final DbHelper _db = DbHelper();
|
||||||
|
int _neueSongs = 0;
|
||||||
|
|
||||||
|
int get anzahlNeueSongs => _neueSongs;
|
||||||
|
|
||||||
|
Future<bool> frageSpeicherZugriff() async {
|
||||||
|
final status = await Permission.audio.request();
|
||||||
|
return status.isGranted;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Song>> scanneMusikOrdner() async {
|
||||||
|
_neueSongs = 0;
|
||||||
|
final gefunden = <Song>[];
|
||||||
|
final pfade = await _sammleMusikPfade();
|
||||||
|
|
||||||
|
for (final pfad in pfade) {
|
||||||
|
try {
|
||||||
|
final file = File(pfad);
|
||||||
|
if (!await file.exists()) continue;
|
||||||
|
final stat = await file.stat();
|
||||||
|
gefunden.add(Song(
|
||||||
|
titel: _dateiNameOhneEndung(pfad),
|
||||||
|
kuenstler: 'Unbekannt',
|
||||||
|
album: '',
|
||||||
|
dauerSekunden: await _ermittleDauer(pfad),
|
||||||
|
dateiPfad: pfad,
|
||||||
|
coverPfad: null,
|
||||||
|
groesseBytes: stat.size,
|
||||||
|
istHeruntergeladen: true,
|
||||||
|
downloadQuelle: 'local',
|
||||||
|
));
|
||||||
|
} catch (_) {
|
||||||
|
// Datei nicht lesbar → überspringen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// In DB speichern
|
||||||
|
final vorhandene = await _db.alleSongs();
|
||||||
|
final vorhandenePfade = vorhandene.map((s) => s.dateiPfad).toSet();
|
||||||
|
|
||||||
|
final neue = gefunden.where((s) => !vorhandenePfade.contains(s.dateiPfad)).toList();
|
||||||
|
if (neue.isNotEmpty) {
|
||||||
|
await _db.songsEinfuegen(neue);
|
||||||
|
_neueSongs = neue.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gefunden;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<String>> _sammleMusikPfade() async {
|
||||||
|
final pfade = <String>{};
|
||||||
|
|
||||||
|
// Typische Musik-Ordner auf Android
|
||||||
|
final ordner = [
|
||||||
|
'/storage/emulated/0/Music',
|
||||||
|
'/storage/emulated/0/Download',
|
||||||
|
'/storage/emulated/0/Musik',
|
||||||
|
'/storage/emulated/0/Downloads',
|
||||||
|
'/sdcard/Music',
|
||||||
|
'/sdcard/Download',
|
||||||
|
'/sdcard/Musik',
|
||||||
|
];
|
||||||
|
|
||||||
|
// Externe SD-Karte (falls vorhanden)
|
||||||
|
try {
|
||||||
|
final extern = await getExternalStorageDirectory();
|
||||||
|
if (extern != null) {
|
||||||
|
ordner.add(extern.path);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
|
// Android Media Store (bessere Methode)
|
||||||
|
try {
|
||||||
|
final pfadeVonMediaStore = await _scanneViaMediaStore();
|
||||||
|
pfade.addAll(pfadeVonMediaStore);
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
|
// Fallback: Dateisystem durchsuchen
|
||||||
|
for (final ord in ordner) {
|
||||||
|
try {
|
||||||
|
final dir = Directory(ord);
|
||||||
|
if (await dir.exists()) {
|
||||||
|
await _durchsucheOrdner(dir, pfade);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pfade.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<String>> _scanneViaMediaStore() async {
|
||||||
|
// Nutzt Android's MediaStore Query
|
||||||
|
// Wird über Method Channel in native Android implementiert
|
||||||
|
// Für v1: Fallback auf Dateisystem-Suche
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _durchsucheOrdner(Directory dir, Set<String> pfade, {int tiefe = 0}) async {
|
||||||
|
if (tiefe > 4) return;
|
||||||
|
try {
|
||||||
|
await for (final entity in dir.list(followLinks: false)) {
|
||||||
|
if (entity is File) {
|
||||||
|
final ext = entity.path.toLowerCase();
|
||||||
|
if (ext.endsWith('.mp3') || ext.endsWith('.m4a') ||
|
||||||
|
ext.endsWith('.flac') || ext.endsWith('.wav') ||
|
||||||
|
ext.endsWith('.aac') || ext.endsWith('.ogg')) {
|
||||||
|
pfade.add(entity.path);
|
||||||
|
}
|
||||||
|
} else if (entity is Directory) {
|
||||||
|
await _durchsucheOrdner(entity, pfade, tiefe: tiefe + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> _ermittleDauer(String pfad) async {
|
||||||
|
try {
|
||||||
|
final player = AudioPlayer();
|
||||||
|
await player.setFilePath(pfad);
|
||||||
|
final dauer = player.duration;
|
||||||
|
await player.dispose();
|
||||||
|
return dauer?.inSeconds ?? 0;
|
||||||
|
} catch (_) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _dateiNameOhneEndung(String pfad) {
|
||||||
|
final name = pfad.split('/').last;
|
||||||
|
final dot = name.lastIndexOf('.');
|
||||||
|
return dot > 0 ? name.substring(0, dot) : name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
|
||||||
|
class PlayerService {
|
||||||
|
static final PlayerService _instanz = PlayerService._();
|
||||||
|
factory PlayerService() => _instanz;
|
||||||
|
PlayerService._();
|
||||||
|
|
||||||
|
AudioPlayer? _player;
|
||||||
|
final List<Song> _warteschlange = [];
|
||||||
|
int _aktuellerIndex = -1;
|
||||||
|
StreamSubscription<PlayerState>? _autoNextSub;
|
||||||
|
|
||||||
|
AudioPlayer get _p {
|
||||||
|
if (_player == null) {
|
||||||
|
_player = AudioPlayer();
|
||||||
|
_autoNextSub = _player!.playerStateStream.listen((state) {
|
||||||
|
if (state.processingState == ProcessingState.completed) {
|
||||||
|
naechstes();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return _player!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Song? get aktuellerSong => _aktuellerIndex >= 0 && _aktuellerIndex < _warteschlange.length
|
||||||
|
? _warteschlange[_aktuellerIndex] : null;
|
||||||
|
bool get spieltAb => _player?.playing ?? false;
|
||||||
|
Duration get position => _player?.position ?? Duration.zero;
|
||||||
|
Duration get dauer => _player?.duration ?? Duration.zero;
|
||||||
|
Stream<Duration> get positionStream => _p.positionStream;
|
||||||
|
Stream<PlayerState> get stateStream => _p.playerStateStream;
|
||||||
|
|
||||||
|
final StreamController<Song?> _songWechsel = StreamController.broadcast();
|
||||||
|
Stream<Song?> get onSongWechsel => _songWechsel.stream;
|
||||||
|
|
||||||
|
Future<void> spiele(Song song, {int position = 0}) async {
|
||||||
|
_aktuellerIndex = _warteschlange.indexWhere((s) => s.id == song.id);
|
||||||
|
if (_aktuellerIndex < 0) {
|
||||||
|
_warteschlange.add(song);
|
||||||
|
_aktuellerIndex = _warteschlange.length - 1;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await _p.setFilePath(song.dateiPfad);
|
||||||
|
if (position > 0) await _p.seek(Duration(seconds: position));
|
||||||
|
await _p.play();
|
||||||
|
_songWechsel.add(song);
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('Fehler beim Abspielen: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> playPause() async {
|
||||||
|
if (_player == null) return;
|
||||||
|
if (_p.playing) {
|
||||||
|
await _p.pause();
|
||||||
|
} else if (aktuellerSong != null) {
|
||||||
|
await _p.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> vorheriges() async {
|
||||||
|
if (_player == null || aktuellerSong == null) return;
|
||||||
|
final pos = _p.position;
|
||||||
|
if (pos.inSeconds > 5) {
|
||||||
|
await _p.seek(Duration.zero);
|
||||||
|
} else {
|
||||||
|
final neuerIndex = _aktuellerIndex - 1;
|
||||||
|
if (neuerIndex >= 0) {
|
||||||
|
await spiele(_warteschlange[neuerIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> naechstes() async {
|
||||||
|
final neuerIndex = _aktuellerIndex + 1;
|
||||||
|
if (neuerIndex < _warteschlange.length) {
|
||||||
|
await spiele(_warteschlange[neuerIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setWarteschlange(List<Song> songs, {int startIndex = 0}) {
|
||||||
|
_warteschlange.clear();
|
||||||
|
_warteschlange.addAll(songs);
|
||||||
|
_aktuellerIndex = startIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispose() {
|
||||||
|
_autoNextSub?.cancel();
|
||||||
|
_player?.dispose();
|
||||||
|
_songWechsel.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MeloTheme {
|
||||||
|
static const Color rot = Color(0xFFCC0000);
|
||||||
|
static const Color rotHell = Color(0x33CC0000);
|
||||||
|
static const Color schwarz = Color(0xFF0D0D0D);
|
||||||
|
static const Color dunkel1 = Color(0xFF1A1A1A);
|
||||||
|
static const Color dunkel2 = Color(0xFF2A2A2A);
|
||||||
|
static const Color textPrimaer = Color(0xFFFFFFFF);
|
||||||
|
static const Color textSekundaer = Color(0xFF888888);
|
||||||
|
|
||||||
|
static ThemeData get theme => ThemeData(
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
scaffoldBackgroundColor: schwarz,
|
||||||
|
colorScheme: const ColorScheme.dark(
|
||||||
|
primary: rot,
|
||||||
|
secondary: rot,
|
||||||
|
surface: schwarz,
|
||||||
|
),
|
||||||
|
appBarTheme: const AppBarTheme(
|
||||||
|
backgroundColor: schwarz,
|
||||||
|
foregroundColor: textPrimaer,
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
|
||||||
|
backgroundColor: schwarz,
|
||||||
|
selectedItemColor: rot,
|
||||||
|
unselectedItemColor: textSekundaer,
|
||||||
|
),
|
||||||
|
cardTheme: CardThemeData(
|
||||||
|
color: dunkel1,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
chipTheme: ChipThemeData(
|
||||||
|
backgroundColor: dunkel1,
|
||||||
|
selectedColor: rot,
|
||||||
|
labelStyle: const TextStyle(color: textPrimaer),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
|
||||||
|
class MeloHeader extends StatelessWidget {
|
||||||
|
final VoidCallback onDownload;
|
||||||
|
final VoidCallback onSearch;
|
||||||
|
|
||||||
|
const MeloHeader({super.key, required this.onDownload, required this.onSearch});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(20, 12, 20, 4),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
ShaderMask(
|
||||||
|
shaderCallback: (bounds) => const LinearGradient(
|
||||||
|
colors: [Colors.white, MeloTheme.rot],
|
||||||
|
).createShader(bounds),
|
||||||
|
child: const Text('Melo', style: TextStyle(
|
||||||
|
fontSize: 28, fontWeight: FontWeight.w700, color: Colors.white)),
|
||||||
|
),
|
||||||
|
const Text('Deine Musik. Deine Art.', style: TextStyle(fontSize: 12, color: MeloTheme.textSekundaer)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(children: [
|
||||||
|
_btn(Icons.download, onDownload),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
_btn(Icons.search, onSearch),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _btn(IconData icon, VoidCallback onTap) {
|
||||||
|
return Container(
|
||||||
|
width: 40, height: 40,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: MeloTheme.dunkel1,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: IconButton(
|
||||||
|
icon: Icon(icon, size: 18, color: MeloTheme.rot),
|
||||||
|
onPressed: onTap,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
import '../database/db_helper.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
|
||||||
|
class MetadatenDialog extends StatefulWidget {
|
||||||
|
final Song song;
|
||||||
|
const MetadatenDialog({super.key, required this.song});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MetadatenDialog> createState() => _MetadatenDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MetadatenDialogState extends State<MetadatenDialog> {
|
||||||
|
late TextEditingController _titelCtrl;
|
||||||
|
late TextEditingController _kuenstlerCtrl;
|
||||||
|
late TextEditingController _albumCtrl;
|
||||||
|
final DbHelper _db = DbHelper();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_titelCtrl = TextEditingController(text: widget.song.titel);
|
||||||
|
_kuenstlerCtrl = TextEditingController(text: widget.song.kuenstler);
|
||||||
|
_albumCtrl = TextEditingController(text: widget.song.album);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_titelCtrl.dispose();
|
||||||
|
_kuenstlerCtrl.dispose();
|
||||||
|
_albumCtrl.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
backgroundColor: MeloTheme.dunkel1,
|
||||||
|
title: const Text('✏️ Metadaten', style: TextStyle(color: Colors.white, fontSize: 18)),
|
||||||
|
content: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
_field('Titel', _titelCtrl),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
_field('Künstler', _kuenstlerCtrl),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
_field('Album', _albumCtrl),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, false),
|
||||||
|
child: const Text('Abbrechen', style: TextStyle(color: Colors.white54)),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => _speichern(),
|
||||||
|
child: const Text('Speichern', style: TextStyle(color: MeloTheme.rot)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _field(String label, TextEditingController ctrl) {
|
||||||
|
return TextField(
|
||||||
|
controller: ctrl,
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: label,
|
||||||
|
labelStyle: const TextStyle(color: Colors.grey),
|
||||||
|
border: const OutlineInputBorder(),
|
||||||
|
focusedBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: MeloTheme.rot),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _speichern() async {
|
||||||
|
final id = widget.song.id;
|
||||||
|
if (id == null) {
|
||||||
|
if (mounted) Navigator.pop(context, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final titel = _titelCtrl.text.trim();
|
||||||
|
final kuenstler = _kuenstlerCtrl.text.trim();
|
||||||
|
final album = _albumCtrl.text.trim();
|
||||||
|
if (titel.isEmpty) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(content: Text('Titel darf nicht leer sein')),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _db.metadatenAktualisieren(
|
||||||
|
id,
|
||||||
|
titel: titel,
|
||||||
|
kuenstler: kuenstler,
|
||||||
|
album: album,
|
||||||
|
);
|
||||||
|
if (mounted) Navigator.pop(context, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
import '../services/player_service.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
|
||||||
|
class MiniPlayer extends StatefulWidget {
|
||||||
|
const MiniPlayer({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MiniPlayer> createState() => _MiniPlayerState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MiniPlayerState extends State<MiniPlayer> {
|
||||||
|
final PlayerService _player = PlayerService();
|
||||||
|
Duration _position = Duration.zero;
|
||||||
|
Duration _dauer = Duration.zero;
|
||||||
|
bool _spielt = false;
|
||||||
|
StreamSubscription<Duration>? _posSub;
|
||||||
|
StreamSubscription<PlayerState>? _stateSub;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_posSub = _player.positionStream.listen((pos) {
|
||||||
|
if (mounted) {
|
||||||
|
setState(() => _position = pos);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
_stateSub = _player.stateStream.listen((state) {
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
_spielt = state.playing;
|
||||||
|
_dauer = state.processingState == ProcessingState.ready
|
||||||
|
? (_player.dauer) : Duration.zero;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_posSub?.cancel();
|
||||||
|
_stateSub?.cancel();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final song = _player.aktuellerSong;
|
||||||
|
if (song == null) return const SizedBox.shrink();
|
||||||
|
|
||||||
|
final progress = _dauer.inSeconds > 0
|
||||||
|
? _position.inSeconds / _dauer.inSeconds : 0.0;
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF1A0A0A),
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
border: Border.all(color: const Color(0xFF2A1515)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(12, 10, 12, 6),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
// Cover
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
child: Container(
|
||||||
|
width: 36, height: 36,
|
||||||
|
color: MeloTheme.rot,
|
||||||
|
child: const Center(child: Text('♪', style: TextStyle(fontSize: 16))),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
// Titel + Künstler
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(song.titel, style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: Colors.white)),
|
||||||
|
Text(song.kuenstler, style: const TextStyle(fontSize: 11, color: MeloTheme.textSekundaer)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Steuerung
|
||||||
|
_btn(Icons.skip_previous, _player.vorheriges),
|
||||||
|
_playBtn(),
|
||||||
|
_btn(Icons.skip_next, _player.naechstes),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Fortschritt
|
||||||
|
if (_dauer.inSeconds > 0) Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(12, 0, 12, 8),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(2),
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: progress,
|
||||||
|
backgroundColor: const Color(0xFF2A2A2A),
|
||||||
|
valueColor: const AlwaysStoppedAnimation(MeloTheme.rot),
|
||||||
|
minHeight: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _btn(IconData icon, VoidCallback onTap) {
|
||||||
|
return Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
onTap: onTap,
|
||||||
|
child: Container(
|
||||||
|
width: 32, height: 32,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Icon(icon, size: 18, color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _playBtn() {
|
||||||
|
return Material(
|
||||||
|
color: MeloTheme.rot,
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
onTap: _player.playPause,
|
||||||
|
child: Container(
|
||||||
|
width: 36, height: 36,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Icon(_spielt ? Icons.pause : Icons.play_arrow, size: 20, color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../models/song.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
import 'metadaten_dialog.dart';
|
||||||
|
|
||||||
|
class SongTile extends StatelessWidget {
|
||||||
|
final Song song;
|
||||||
|
final bool istFavorit;
|
||||||
|
final ValueChanged<Song> onFavoriteToggle;
|
||||||
|
final ValueChanged<Song> onPlay;
|
||||||
|
final VoidCallback onMetadataChanged;
|
||||||
|
|
||||||
|
const SongTile({
|
||||||
|
super.key,
|
||||||
|
required this.song,
|
||||||
|
required this.istFavorit,
|
||||||
|
required this.onFavoriteToggle,
|
||||||
|
required this.onPlay,
|
||||||
|
required this.onMetadataChanged,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final hatDatei = song.dateiPfad.isNotEmpty;
|
||||||
|
return ListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(vertical: 2),
|
||||||
|
leading: Container(
|
||||||
|
width: 44, height: 44,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
gradient: const LinearGradient(colors: [Color(0xFF1A0000), Color(0xFF660000)]),
|
||||||
|
),
|
||||||
|
child: const Center(child: Text('♪', style: TextStyle(fontSize: 18, color: Colors.white54))),
|
||||||
|
),
|
||||||
|
title: Text(song.titel, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white)),
|
||||||
|
subtitle: Text(song.kuenstler, style: const TextStyle(fontSize: 12, color: MeloTheme.textSekundaer)),
|
||||||
|
trailing: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
onTap: () async {
|
||||||
|
final geaendert = await showDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => MetadatenDialog(song: song),
|
||||||
|
);
|
||||||
|
if (geaendert == true) onMetadataChanged();
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(6),
|
||||||
|
child: Icon(Icons.edit, size: 14, color: MeloTheme.textSekundaer),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
onTap: () => onFavoriteToggle(song),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(6),
|
||||||
|
child: Icon(
|
||||||
|
istFavorit ? Icons.favorite : Icons.favorite_border,
|
||||||
|
size: 16, color: MeloTheme.rot,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(song.dauerFormatiert, style: const TextStyle(fontSize: 12, color: MeloTheme.textSekundaer)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: hatDatei ? () => onPlay(song) : null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
|
||||||
|
class StatistikCard extends StatelessWidget {
|
||||||
|
final int anzahlSongs;
|
||||||
|
final String gesamtMB;
|
||||||
|
final int gesamtMin;
|
||||||
|
final int anzahlFavoriten;
|
||||||
|
|
||||||
|
const StatistikCard({
|
||||||
|
super.key,
|
||||||
|
required this.anzahlSongs,
|
||||||
|
required this.gesamtMB,
|
||||||
|
required this.gesamtMin,
|
||||||
|
required this.anzahlFavoriten,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF1A0A0A),
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
|
border: Border.all(color: const Color(0xFF2A1515)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
_item('$anzahlSongs', 'Lieder'),
|
||||||
|
_item(gesamtMB, 'MB'),
|
||||||
|
_item('$gesamtMin', 'Min'),
|
||||||
|
_item('$anzahlFavoriten', 'Favoriten'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _item(String zahl, String label) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Text(zahl, style: const TextStyle(fontSize: 22, fontWeight: FontWeight.w700, color: MeloTheme.rot)),
|
||||||
|
Text(label, style: const TextStyle(fontSize: 11, color: MeloTheme.textSekundaer)),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../utils/farb_theme.dart';
|
||||||
|
|
||||||
|
class TagLeiste extends StatelessWidget {
|
||||||
|
final List<Map<String, String>> tags;
|
||||||
|
final String aktiverTag;
|
||||||
|
final ValueChanged<String> onTagSelected;
|
||||||
|
|
||||||
|
const TagLeiste({
|
||||||
|
super.key,
|
||||||
|
required this.tags,
|
||||||
|
required this.aktiverTag,
|
||||||
|
required this.onTagSelected,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(20, 8, 20, 4),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text('🏷️ Tags', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white)),
|
||||||
|
Text('+ Neu', style: TextStyle(fontSize: 12, color: MeloTheme.rot, fontWeight: FontWeight.w500)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 36,
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
children: tags.map((tag) {
|
||||||
|
final aktiv = aktiverTag == tag['name'];
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 8),
|
||||||
|
child: FilterChip(
|
||||||
|
label: Text('${tag['icon']} ${tag['name']}',
|
||||||
|
style: TextStyle(fontSize: 13, color: aktiv ? Colors.white : MeloTheme.textSekundaer)),
|
||||||
|
selected: aktiv,
|
||||||
|
onSelected: (_) => onTagSelected(tag['name']!),
|
||||||
|
selectedColor: MeloTheme.rot,
|
||||||
|
backgroundColor: MeloTheme.dunkel1,
|
||||||
|
side: BorderSide.none,
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
flutter/ephemeral
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# Project-level configuration.
|
||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
project(runner LANGUAGES CXX)
|
||||||
|
|
||||||
|
# The name of the executable created for the application. Change this to change
|
||||||
|
# the on-disk name of your application.
|
||||||
|
set(BINARY_NAME "melo_app")
|
||||||
|
# The unique GTK application identifier for this application. See:
|
||||||
|
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||||
|
set(APPLICATION_ID "com.melo.melo_app")
|
||||||
|
|
||||||
|
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||||
|
# versions of CMake.
|
||||||
|
cmake_policy(SET CMP0063 NEW)
|
||||||
|
|
||||||
|
# Load bundled libraries from the lib/ directory relative to the binary.
|
||||||
|
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
||||||
|
|
||||||
|
# Root filesystem for cross-building.
|
||||||
|
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
||||||
|
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Define build configuration options.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
||||||
|
STRING "Flutter build mode" FORCE)
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||||
|
"Debug" "Profile" "Release")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Compilation settings that should be applied to most targets.
|
||||||
|
#
|
||||||
|
# Be cautious about adding new options here, as plugins use this function by
|
||||||
|
# default. In most cases, you should add new options to specific targets instead
|
||||||
|
# of modifying this function.
|
||||||
|
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||||
|
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
||||||
|
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
||||||
|
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
||||||
|
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Flutter library and tool build rules.
|
||||||
|
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||||
|
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
||||||
|
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
|
||||||
|
# Application build; see runner/CMakeLists.txt.
|
||||||
|
add_subdirectory("runner")
|
||||||
|
|
||||||
|
# Run the Flutter tool portions of the build. This must not be removed.
|
||||||
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||||
|
|
||||||
|
# Only the install-generated bundle's copy of the executable will launch
|
||||||
|
# correctly, since the resources must in the right relative locations. To avoid
|
||||||
|
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
||||||
|
# the default top-level location.
|
||||||
|
set_target_properties(${BINARY_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Generated plugin build rules, which manage building the plugins and adding
|
||||||
|
# them to the application.
|
||||||
|
include(flutter/generated_plugins.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
# === Installation ===
|
||||||
|
# By default, "installing" just makes a relocatable bundle in the build
|
||||||
|
# directory.
|
||||||
|
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
|
||||||
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Start with a clean build bundle directory every time.
|
||||||
|
install(CODE "
|
||||||
|
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
|
||||||
|
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
||||||
|
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
|
|
||||||
|
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
|
||||||
|
install(FILES "${bundled_library}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endforeach(bundled_library)
|
||||||
|
|
||||||
|
# Copy the native assets provided by the build.dart from all packages.
|
||||||
|
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
|
||||||
|
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
# Fully re-copy the assets directory on each build to avoid having stale files
|
||||||
|
# from a previous install.
|
||||||
|
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
||||||
|
install(CODE "
|
||||||
|
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
||||||
|
|
||||||
|
# Install the AOT library on non-Debug builds only.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
# This file controls Flutter-level build steps. It should not be edited.
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
|
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
||||||
|
|
||||||
|
# Configuration provided via flutter tool.
|
||||||
|
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
||||||
|
|
||||||
|
# TODO: Move the rest of this into files in ephemeral. See
|
||||||
|
# https://github.com/flutter/flutter/issues/57146.
|
||||||
|
|
||||||
|
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
||||||
|
# which isn't available in 3.10.
|
||||||
|
function(list_prepend LIST_NAME PREFIX)
|
||||||
|
set(NEW_LIST "")
|
||||||
|
foreach(element ${${LIST_NAME}})
|
||||||
|
list(APPEND NEW_LIST "${PREFIX}${element}")
|
||||||
|
endforeach(element)
|
||||||
|
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# === Flutter Library ===
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
||||||
|
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||||
|
|
||||||
|
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
||||||
|
|
||||||
|
# Published to parent scope for install step.
|
||||||
|
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
||||||
|
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
||||||
|
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
||||||
|
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_LIBRARY_HEADERS
|
||||||
|
"fl_basic_message_channel.h"
|
||||||
|
"fl_binary_codec.h"
|
||||||
|
"fl_binary_messenger.h"
|
||||||
|
"fl_dart_project.h"
|
||||||
|
"fl_engine.h"
|
||||||
|
"fl_json_message_codec.h"
|
||||||
|
"fl_json_method_codec.h"
|
||||||
|
"fl_message_codec.h"
|
||||||
|
"fl_method_call.h"
|
||||||
|
"fl_method_channel.h"
|
||||||
|
"fl_method_codec.h"
|
||||||
|
"fl_method_response.h"
|
||||||
|
"fl_plugin_registrar.h"
|
||||||
|
"fl_plugin_registry.h"
|
||||||
|
"fl_standard_message_codec.h"
|
||||||
|
"fl_standard_method_codec.h"
|
||||||
|
"fl_string_codec.h"
|
||||||
|
"fl_value.h"
|
||||||
|
"fl_view.h"
|
||||||
|
"flutter_linux.h"
|
||||||
|
)
|
||||||
|
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
||||||
|
add_library(flutter INTERFACE)
|
||||||
|
target_include_directories(flutter INTERFACE
|
||||||
|
"${EPHEMERAL_DIR}"
|
||||||
|
)
|
||||||
|
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
||||||
|
target_link_libraries(flutter INTERFACE
|
||||||
|
PkgConfig::GTK
|
||||||
|
PkgConfig::GLIB
|
||||||
|
PkgConfig::GIO
|
||||||
|
)
|
||||||
|
add_dependencies(flutter flutter_assemble)
|
||||||
|
|
||||||
|
# === Flutter tool backend ===
|
||||||
|
# _phony_ is a non-existent file to force this command to run every time,
|
||||||
|
# since currently there's no way to get a full input/output list from the
|
||||||
|
# flutter tool.
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env
|
||||||
|
${FLUTTER_TOOL_ENVIRONMENT}
|
||||||
|
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
||||||
|
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
add_custom_target(flutter_assemble DEPENDS
|
||||||
|
"${FLUTTER_LIBRARY}"
|
||||||
|
${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
)
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
|
||||||
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
||||||
|
#define GENERATED_PLUGIN_REGISTRANT_
|
||||||
|
|
||||||
|
#include <flutter_linux/flutter_linux.h>
|
||||||
|
|
||||||
|
// Registers Flutter plugins.
|
||||||
|
void fl_register_plugins(FlPluginRegistry* registry);
|
||||||
|
|
||||||
|
#endif // GENERATED_PLUGIN_REGISTRANT_
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Generated file, do not edit.
|
||||||
|
#
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
jni
|
||||||
|
)
|
||||||
|
|
||||||
|
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||||
|
|
||||||
|
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||||
|
endforeach(plugin)
|
||||||
|
|
||||||
|
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||||
|
endforeach(ffi_plugin)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
project(runner LANGUAGES CXX)
|
||||||
|
|
||||||
|
# Define the application target. To change its name, change BINARY_NAME in the
|
||||||
|
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
||||||
|
# work.
|
||||||
|
#
|
||||||
|
# Any new source files that you add to the application should be added here.
|
||||||
|
add_executable(${BINARY_NAME}
|
||||||
|
"main.cc"
|
||||||
|
"my_application.cc"
|
||||||
|
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Apply the standard set of build settings. This can be removed for applications
|
||||||
|
# that need different build settings.
|
||||||
|
apply_standard_settings(${BINARY_NAME})
|
||||||
|
|
||||||
|
# Add preprocessor definitions for the application ID.
|
||||||
|
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||||
|
|
||||||
|
# Add dependency libraries. Add any application-specific dependencies here.
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||||
|
|
||||||
|
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#include "my_application.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
g_autoptr(MyApplication) app = my_application_new();
|
||||||
|
return g_application_run(G_APPLICATION(app), argc, argv);
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
#include "my_application.h"
|
||||||
|
|
||||||
|
#include <flutter_linux/flutter_linux.h>
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
#include <gdk/gdkx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "flutter/generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
struct _MyApplication {
|
||||||
|
GtkApplication parent_instance;
|
||||||
|
char** dart_entrypoint_arguments;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
||||||
|
|
||||||
|
// Called when first Flutter frame received.
|
||||||
|
static void first_frame_cb(MyApplication* self, FlView* view) {
|
||||||
|
gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::activate.
|
||||||
|
static void my_application_activate(GApplication* application) {
|
||||||
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
|
GtkWindow* window =
|
||||||
|
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
||||||
|
|
||||||
|
// Use a header bar when running in GNOME as this is the common style used
|
||||||
|
// by applications and is the setup most users will be using (e.g. Ubuntu
|
||||||
|
// desktop).
|
||||||
|
// If running on X and not using GNOME then just use a traditional title bar
|
||||||
|
// in case the window manager does more exotic layout, e.g. tiling.
|
||||||
|
// If running on Wayland assume the header bar will work (may need changing
|
||||||
|
// if future cases occur).
|
||||||
|
gboolean use_header_bar = TRUE;
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
GdkScreen* screen = gtk_window_get_screen(window);
|
||||||
|
if (GDK_IS_X11_SCREEN(screen)) {
|
||||||
|
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
|
||||||
|
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
|
||||||
|
use_header_bar = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (use_header_bar) {
|
||||||
|
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
||||||
|
gtk_widget_show(GTK_WIDGET(header_bar));
|
||||||
|
gtk_header_bar_set_title(header_bar, "melo_app");
|
||||||
|
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
||||||
|
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
||||||
|
} else {
|
||||||
|
gtk_window_set_title(window, "melo_app");
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_window_set_default_size(window, 1280, 720);
|
||||||
|
|
||||||
|
g_autoptr(FlDartProject) project = fl_dart_project_new();
|
||||||
|
fl_dart_project_set_dart_entrypoint_arguments(
|
||||||
|
project, self->dart_entrypoint_arguments);
|
||||||
|
|
||||||
|
FlView* view = fl_view_new(project);
|
||||||
|
GdkRGBA background_color;
|
||||||
|
// Background defaults to black, override it here if necessary, e.g. #00000000
|
||||||
|
// for transparent.
|
||||||
|
gdk_rgba_parse(&background_color, "#000000");
|
||||||
|
fl_view_set_background_color(view, &background_color);
|
||||||
|
gtk_widget_show(GTK_WIDGET(view));
|
||||||
|
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
|
||||||
|
|
||||||
|
// Show the window when Flutter renders.
|
||||||
|
// Requires the view to be realized so we can start rendering.
|
||||||
|
g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb),
|
||||||
|
self);
|
||||||
|
gtk_widget_realize(GTK_WIDGET(view));
|
||||||
|
|
||||||
|
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
|
||||||
|
|
||||||
|
gtk_widget_grab_focus(GTK_WIDGET(view));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::local_command_line.
|
||||||
|
static gboolean my_application_local_command_line(GApplication* application,
|
||||||
|
gchar*** arguments,
|
||||||
|
int* exit_status) {
|
||||||
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
|
// Strip out the first argument as it is the binary name.
|
||||||
|
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
|
||||||
|
|
||||||
|
g_autoptr(GError) error = nullptr;
|
||||||
|
if (!g_application_register(application, nullptr, &error)) {
|
||||||
|
g_warning("Failed to register: %s", error->message);
|
||||||
|
*exit_status = 1;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_application_activate(application);
|
||||||
|
*exit_status = 0;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::startup.
|
||||||
|
static void my_application_startup(GApplication* application) {
|
||||||
|
// MyApplication* self = MY_APPLICATION(object);
|
||||||
|
|
||||||
|
// Perform any actions required at application startup.
|
||||||
|
|
||||||
|
G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::shutdown.
|
||||||
|
static void my_application_shutdown(GApplication* application) {
|
||||||
|
// MyApplication* self = MY_APPLICATION(object);
|
||||||
|
|
||||||
|
// Perform any actions required at application shutdown.
|
||||||
|
|
||||||
|
G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GObject::dispose.
|
||||||
|
static void my_application_dispose(GObject* object) {
|
||||||
|
MyApplication* self = MY_APPLICATION(object);
|
||||||
|
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
|
||||||
|
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void my_application_class_init(MyApplicationClass* klass) {
|
||||||
|
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
|
||||||
|
G_APPLICATION_CLASS(klass)->local_command_line =
|
||||||
|
my_application_local_command_line;
|
||||||
|
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
|
||||||
|
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
|
||||||
|
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void my_application_init(MyApplication* self) {}
|
||||||
|
|
||||||
|
MyApplication* my_application_new() {
|
||||||
|
// Set the program name to the application ID, which helps various systems
|
||||||
|
// like GTK and desktop environments map this running application to its
|
||||||
|
// corresponding .desktop file. This ensures better integration by allowing
|
||||||
|
// the application to be recognized beyond its binary name.
|
||||||
|
g_set_prgname(APPLICATION_ID);
|
||||||
|
|
||||||
|
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
||||||
|
"application-id", APPLICATION_ID, "flags",
|
||||||
|
G_APPLICATION_NON_UNIQUE, nullptr));
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef FLUTTER_MY_APPLICATION_H_
|
||||||
|
#define FLUTTER_MY_APPLICATION_H_
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE(MyApplication,
|
||||||
|
my_application,
|
||||||
|
MY,
|
||||||
|
APPLICATION,
|
||||||
|
GtkApplication)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* my_application_new:
|
||||||
|
*
|
||||||
|
* Creates a new Flutter-based application.
|
||||||
|
*
|
||||||
|
* Returns: a new #MyApplication.
|
||||||
|
*/
|
||||||
|
MyApplication* my_application_new();
|
||||||
|
|
||||||
|
#endif // FLUTTER_MY_APPLICATION_H_
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Flutter-related
|
||||||
|
**/Flutter/ephemeral/
|
||||||
|
**/Pods/
|
||||||
|
|
||||||
|
# Xcode-related
|
||||||
|
**/dgph
|
||||||
|
**/xcuserdata/
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
import FlutterMacOS
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
import audio_service
|
||||||
|
import audio_session
|
||||||
|
import just_audio
|
||||||
|
import shared_preferences_foundation
|
||||||
|
import sqflite_darwin
|
||||||
|
|
||||||
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
AudioServicePlugin.register(with: registry.registrar(forPlugin: "AudioServicePlugin"))
|
||||||
|
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
|
||||||
|
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
|
||||||
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
platform :osx, '10.15'
|
||||||
|
|
||||||
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
|
||||||
|
project 'Runner', {
|
||||||
|
'Debug' => :debug,
|
||||||
|
'Profile' => :release,
|
||||||
|
'Release' => :release,
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutter_root
|
||||||
|
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
|
||||||
|
unless File.exist?(generated_xcode_build_settings_path)
|
||||||
|
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
|
||||||
|
end
|
||||||
|
|
||||||
|
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||||
|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||||
|
return matches[1].strip if matches
|
||||||
|
end
|
||||||
|
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
|
||||||
|
end
|
||||||
|
|
||||||
|
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||||
|
|
||||||
|
flutter_macos_podfile_setup
|
||||||
|
|
||||||
|
target 'Runner' do
|
||||||
|
use_frameworks!
|
||||||
|
|
||||||
|
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
|
||||||
|
target 'RunnerTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
installer.pods_project.targets.each do |target|
|
||||||
|
flutter_additional_macos_build_settings(target)
|
||||||
|
end
|
||||||
|
end
|
||||||