Update lib/screens/scan_tab.dart

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Lukas Müllner 2026-02-24 20:14:48 +01:00 committed by GitHub
parent ae39f2cbaf
commit 94e0ab436b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,8 +150,10 @@ class ScanTabState extends State<ScanTab> {
.toList(),
onChanged: (id) {
setState(() {
_selectedCollection = _collections
.firstWhere((c) => c.id == id);
final matching =
_collections.where((c) => c.id == id);
_selectedCollection =
matching.isNotEmpty ? matching.first : null;
});
},
),