Kein Redesign — Schwarz/Rot, 4 Tabs und Lieder/Kategorie bleiben. Grundlage sind die Design-Skills: ui-ux-pro-max (Barrierefreiheit, Touch, Typografie, Bewegung), ui-design/mobile-android (Material 3) und die Token-Disziplin aus Hue. Behobene Maengel (messbar, nicht Geschmack): - Text in Colors.white38 an 17 Stellen = 3,4:1 Kontrast, WCAG verlangt 4,5:1. Ersetzt durch drei benannte Stufen (text1 15,9:1 / text2 8,8:1 / text3 4,9:1). theme_kontrast_test.dart rechnet die Verhaeltnisse bei jedem Lauf nach, statt sie zu behaupten. - SubTabs waren ~38 dp hoch (Material 3 verlangt 48), ohne Ripple und ohne Uebergang. Jetzt 48 dp, InkWell, AnimatedContainer, und die Auswahl wird Vorlesehilfen als Zustand gemeldet (Semantics.selected). - mini_player.dart: Expanded UM eine feste Hoehe herum — zwei widerspruechliche Angaben. Entschaerft. - Emoji in Bedienelementen der Einstellungen (jeweils neben einem echten Icon) entfernt. Neu in shared/theme.dart: MeloSpace (8er-Raster), MeloRadius, MeloMotion, Farbrollen text1/2/3 + border + hairline, minTouchTarget, vollstaendiges textTheme (7 Stufen) und Themes fuer Listen, Sheets, Snackbars, Fortschritt, Trenner. 318 Tests gruen (23 neue, 1 uebersprungen), flutter analyze ohne Befund. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FpPu4nuKjKKeX1RpdDeX81
60 lines
1.7 KiB
Dart
60 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'database.dart';
|
|
import 'song_list.dart';
|
|
import '../shared/theme.dart';
|
|
|
|
class SearchScreen extends StatefulWidget {
|
|
const SearchScreen({super.key});
|
|
|
|
@override
|
|
State<SearchScreen> createState() => _SearchScreenState();
|
|
}
|
|
|
|
class _SearchScreenState extends State<SearchScreen> {
|
|
String _query = '';
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final db = context.read<MeloDb>();
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: TextField(
|
|
autofocus: false,
|
|
decoration: const InputDecoration(
|
|
hintText: 'Titel, Künstler, Album …',
|
|
border: InputBorder.none,
|
|
prefixIcon: Icon(Icons.search),
|
|
),
|
|
onChanged: (v) => setState(() => _query = v.trim()),
|
|
),
|
|
),
|
|
body: _query.isEmpty
|
|
? const Center(
|
|
child: Text('Suchbegriff eingeben',
|
|
style: TextStyle(color: MeloTheme.text2)),
|
|
)
|
|
: StreamBuilder<List<Song>>(
|
|
stream: db.searchSongs(_query),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.hasError) {
|
|
return Center(
|
|
child: Text('Fehler: ${snapshot.error}',
|
|
style: const TextStyle(color: MeloTheme.text2)),
|
|
);
|
|
}
|
|
final songs = snapshot.data ?? const [];
|
|
if (songs.isEmpty) {
|
|
return const Center(
|
|
child: Text('Nichts gefunden',
|
|
style: TextStyle(color: MeloTheme.text2)),
|
|
);
|
|
}
|
|
return SongList(songs);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|