Implementierung der Games #203

Merged
flixcoo merged 34 commits from feature/119-implementierung-der-games-2 into development 2026-05-09 17:13:46 +00:00
3 changed files with 9 additions and 2 deletions
Showing only changes of commit 5d832c98a7 - Show all commits

View File

@@ -177,6 +177,7 @@ class _ChooseGameViewState extends State<ChooseGameView> {
if (result.delete) { if (result.delete) {
setState(() { setState(() {
widget.games.removeAt(originalIndex); widget.games.removeAt(originalIndex);
widget.onGamesUpdated?.call();
}); });
} else { } else {
setState(() { setState(() {

View File

@@ -28,10 +28,13 @@ class CreateMatchView extends StatefulWidget {
this.onWinnerChanged, this.onWinnerChanged,
this.matchToEdit, this.matchToEdit,
this.onMatchUpdated, this.onMatchUpdated,
this.onMatchesUpdated,
}); });
final VoidCallback? onWinnerChanged; final VoidCallback? onWinnerChanged;
final VoidCallback? onMatchesUpdated;
sneeex marked this conversation as resolved
Review

ist das das callback wenn ein match im edit view/create view gemacht wurde und dann in der liste aktualisiert werden soll?

ist das das callback wenn ein match im edit view/create view gemacht wurde und dann in der liste aktualisiert werden soll?
Review

das ist der callback für die MatchDetailView an erster stelle, um dort das Match zu aktualisieren

das ist der callback für die MatchDetailView an erster stelle, um dort das Match zu aktualisieren
Review

ne das ist doch on match update, on matches updated ist doch was anderes?

ne das ist doch on match update, on matches updated ist doch was anderes?
Review

Ja onMatchUpdate ist für ein einzelnes Match und onMatchesUpdate für alle Matches im MatchView

Ja onMatchUpdate ist für ein einzelnes Match und onMatchesUpdate für alle Matches im MatchView
final void Function(Match)? onMatchUpdated; final void Function(Match)? onMatchUpdated;
/// An optional match to prefill the fields for editing. /// An optional match to prefill the fields for editing.
@@ -138,6 +141,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
builder: (context) => ChooseGameView( builder: (context) => ChooseGameView(
games: gamesList, games: gamesList,
initialGameId: selectedGame?.id ?? '', initialGameId: selectedGame?.id ?? '',
onGamesUpdated: widget.onMatchesUpdated,
), ),
), ),
); );

View File

@@ -118,8 +118,10 @@ class _MatchViewState extends State<MatchView> {
Navigator.push( Navigator.push(
context, context,
adaptivePageRoute( adaptivePageRoute(
builder: (context) => builder: (context) => CreateMatchView(
CreateMatchView(onWinnerChanged: loadMatches), onWinnerChanged: loadMatches,
onMatchesUpdated: loadMatches,
),
), ),
); );
}, },