Renamed MatchResultView and match variable
This commit is contained in:
@@ -239,7 +239,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
fullscreenDialog: true,
|
||||
builder: (context) => GameResultView(
|
||||
builder: (context) => MatchResultView(
|
||||
match: match,
|
||||
onWinnerChanged: widget.onWinnerChanged,
|
||||
),
|
||||
|
||||
@@ -6,17 +6,17 @@ import 'package:game_tracker/data/dto/player.dart';
|
||||
import 'package:game_tracker/presentation/widgets/tiles/custom_radio_list_tile.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class GameResultView extends StatefulWidget {
|
||||
class MatchResultView extends StatefulWidget {
|
||||
final Match match;
|
||||
|
||||
final VoidCallback? onWinnerChanged;
|
||||
|
||||
const GameResultView({super.key, required this.match, this.onWinnerChanged});
|
||||
const MatchResultView({super.key, required this.match, this.onWinnerChanged});
|
||||
@override
|
||||
State<GameResultView> createState() => _GameResultViewState();
|
||||
State<MatchResultView> createState() => _MatchResultViewState();
|
||||
}
|
||||
|
||||
class _GameResultViewState extends State<GameResultView> {
|
||||
class _MatchResultViewState extends State<MatchResultView> {
|
||||
late final List<Player> allPlayers;
|
||||
late final AppDatabase db;
|
||||
Player? _selectedPlayer;
|
||||
@@ -142,12 +142,12 @@ class _GameResultViewState extends State<GameResultView> {
|
||||
widget.onWinnerChanged?.call();
|
||||
}
|
||||
|
||||
List<Player> getAllPlayers(Match game) {
|
||||
if (game.group == null && game.players != null) {
|
||||
return [...game.players!];
|
||||
} else if (game.group != null && game.players != null) {
|
||||
return [...game.players!, ...game.group!.members];
|
||||
List<Player> getAllPlayers(Match match) {
|
||||
if (match.group == null && match.players != null) {
|
||||
return [...match.players!];
|
||||
} else if (match.group != null && match.players != null) {
|
||||
return [...match.players!, ...match.group!.members];
|
||||
}
|
||||
return [...game.group!.members];
|
||||
return [...match.group!.members];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class _MatchViewState extends State<MatchView> {
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
fullscreenDialog: true,
|
||||
builder: (context) => GameResultView(
|
||||
builder: (context) => MatchResultView(
|
||||
match: matches[index],
|
||||
onWinnerChanged: loadGames,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user