Updated RoundView buttons when game is finished

This commit is contained in:
2025-07-11 11:40:26 +02:00
parent 4ae4a87daa
commit 340a022070
2 changed files with 19 additions and 16 deletions

View File

@@ -73,7 +73,8 @@ class _RoundViewState extends State<RoundView> {
resizeToAvoidBottomInset: false,
navigationBar: CupertinoNavigationBar(
transitionBetweenRoutes: true,
middle: Text(AppLocalizations.of(context).results),
middle: Text(
'${AppLocalizations.of(context).results}${gameSession.isGameFinished ? ' \u{1F512}' : ''}'),
leading: CupertinoButton(
padding: EdgeInsets.zero,
onPressed: () =>
@@ -293,21 +294,23 @@ class _RoundViewState extends State<RoundView> {
: null,
child: Text(AppLocalizations.of(context).done),
),
CupertinoButton(
onPressed: _areRoundInputsValid()
? () {
_finishRound();
LocalStorageService.saveGameSessions();
if (widget.gameSession.isGameFinished == true) {
Navigator.pop(context);
} else {
Navigator.pop(
context, widget.roundNumber + 1);
if (!widget.gameSession.isGameFinished)
CupertinoButton(
onPressed: _areRoundInputsValid()
? () {
_finishRound();
LocalStorageService.saveGameSessions();
if (widget.gameSession.isGameFinished ==
true) {
Navigator.pop(context);
} else {
Navigator.pop(
context, widget.roundNumber + 1);
}
}
}
: null,
child: Text(AppLocalizations.of(context).next_round),
),
: null,
child: Text(AppLocalizations.of(context).next_round),
),
],
),
);

View File

@@ -2,7 +2,7 @@ name: cabo_counter
description: "Mobile app for the card game Cabo"
publish_to: 'none'
version: 0.4.2+473
version: 0.4.2+474
environment:
sdk: ^3.5.4