Fehlende Methoden für Games Datenbank inplementieren #76

Merged
flixcoo merged 35 commits from feature/74-fehlende-methoden-für-games-datenbank-inplementieren into development 2025-12-05 17:54:13 +00:00
Showing only changes of commit c284d10943 - Show all commits

View File

@@ -5,12 +5,12 @@ import 'package:game_tracker/presentation/widgets/tiles/group_tile.dart';
class ChooseGroupView extends StatefulWidget { class ChooseGroupView extends StatefulWidget {
final List<Group> groups; final List<Group> groups;
final int? selectedGroupIndex; final int initialGroupIndex;
const ChooseGroupView({ const ChooseGroupView({
super.key, super.key,
required this.groups, required this.groups,
this.selectedGroupIndex, required this.initialGroupIndex,
}); });
@override @override
@@ -18,11 +18,11 @@ class ChooseGroupView extends StatefulWidget {
} }
class _ChooseGroupViewState extends State<ChooseGroupView> { class _ChooseGroupViewState extends State<ChooseGroupView> {
late int selectedGroup; late int selectedGroupIndex;
@override @override
void initState() { void initState() {
selectedGroup = widget.selectedGroupIndex ?? -1; selectedGroupIndex = widget.initialGroupIndex;
super.initState(); super.initState();
} }
@@ -46,16 +46,17 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
selectedGroup = index; selectedGroupIndex = index;
}); });
Future.delayed(const Duration(milliseconds: 500), () { Future.delayed(const Duration(milliseconds: 500), () {
if (!context.mounted) return;
Navigator.of(context).pop(widget.groups[index]); Navigator.of(context).pop(widget.groups[index]);
}); });
}, },
child: GroupTile( child: GroupTile(
group: widget.groups[index], group: widget.groups[index],
isHighlighted: selectedGroup == index, isHighlighted: selectedGroupIndex == index,
), ),
); );
}, },