add player change callbacks and improve player detail view
Some checks failed
Pull Request Pipeline / test (pull_request) Failing after 47s
Pull Request Pipeline / lint (pull_request) Failing after 53s

This commit is contained in:
2026-05-20 19:50:34 +02:00
parent b305145d34
commit 869c70ff63
6 changed files with 102 additions and 30 deletions

View File

@@ -17,6 +17,7 @@ class GroupTile extends StatefulWidget {
required this.group,
this.isHighlighted = false,
this.onTap,
this.onPlayerChanged,
});
/// The group data to be displayed.
@@ -28,6 +29,9 @@ class GroupTile extends StatefulWidget {
/// Callback function to be executed when the tile is tapped.
final VoidCallback? onTap;
/// Callback function to be executed when the players in the group are changed.
final VoidCallback? onPlayerChanged;
@override
State<GroupTile> createState() => _GroupTileState();
}
@@ -101,7 +105,7 @@ class _GroupTileState extends State<GroupTile> {
builder: (context) => PlayerDetailView(
player: member,
callback: () {
//TODO: implement callback
widget.onPlayerChanged?.call();
},
),
),

View File

@@ -26,6 +26,7 @@ class MatchTile extends StatefulWidget {
required this.onTap,
this.width,
this.compact = false,
this.onPlayerEdited,
});
/// The match data to be displayed.
@@ -34,6 +35,9 @@ class MatchTile extends StatefulWidget {
/// The callback invoked when the tile is tapped.
final VoidCallback onTap;
/// The callback invoked when the players are edited
final VoidCallback? onPlayerEdited;
/// Optional width for the tile.
final double? width;
@@ -233,7 +237,7 @@ class _MatchTileState extends State<MatchTile> {
builder: (context) => PlayerDetailView(
player: player,
callback: () {
//TODO: implement callback
widget.onPlayerEdited?.call();
},
),
),