Updated RoundView buttons when game is finished
This commit is contained in:
@@ -73,7 +73,8 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
transitionBetweenRoutes: true,
|
transitionBetweenRoutes: true,
|
||||||
middle: Text(AppLocalizations.of(context).results),
|
middle: Text(
|
||||||
|
'${AppLocalizations.of(context).results}${gameSession.isGameFinished ? ' \u{1F512}' : ''}'),
|
||||||
leading: CupertinoButton(
|
leading: CupertinoButton(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
@@ -293,21 +294,23 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
: null,
|
: null,
|
||||||
child: Text(AppLocalizations.of(context).done),
|
child: Text(AppLocalizations.of(context).done),
|
||||||
),
|
),
|
||||||
CupertinoButton(
|
if (!widget.gameSession.isGameFinished)
|
||||||
onPressed: _areRoundInputsValid()
|
CupertinoButton(
|
||||||
? () {
|
onPressed: _areRoundInputsValid()
|
||||||
_finishRound();
|
? () {
|
||||||
LocalStorageService.saveGameSessions();
|
_finishRound();
|
||||||
if (widget.gameSession.isGameFinished == true) {
|
LocalStorageService.saveGameSessions();
|
||||||
Navigator.pop(context);
|
if (widget.gameSession.isGameFinished ==
|
||||||
} else {
|
true) {
|
||||||
Navigator.pop(
|
Navigator.pop(context);
|
||||||
context, widget.roundNumber + 1);
|
} else {
|
||||||
|
Navigator.pop(
|
||||||
|
context, widget.roundNumber + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
: null,
|
||||||
: null,
|
child: Text(AppLocalizations.of(context).next_round),
|
||||||
child: Text(AppLocalizations.of(context).next_round),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.4.2+473
|
version: 0.4.2+474
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user