Merge pull request #98 from flixcoo/enhance/91-fixing-next-round-button-behaviour
Updated RoundView buttons when game is finished
This commit is contained in:
@@ -73,13 +73,19 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
transitionBetweenRoutes: true,
|
transitionBetweenRoutes: true,
|
||||||
middle: Text(AppLocalizations.of(context).results),
|
|
||||||
leading: CupertinoButton(
|
leading: CupertinoButton(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
{LocalStorageService.saveGameSessions(), Navigator.pop(context)},
|
{LocalStorageService.saveGameSessions(), Navigator.pop(context)},
|
||||||
child: Text(AppLocalizations.of(context).cancel),
|
child: Text(AppLocalizations.of(context).cancel),
|
||||||
),
|
),
|
||||||
|
middle: Text(AppLocalizations.of(context).results),
|
||||||
|
trailing: widget.gameSession.isGameFinished
|
||||||
|
? const Icon(
|
||||||
|
CupertinoIcons.lock,
|
||||||
|
size: 25,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -293,12 +299,13 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
: null,
|
: null,
|
||||||
child: Text(AppLocalizations.of(context).done),
|
child: Text(AppLocalizations.of(context).done),
|
||||||
),
|
),
|
||||||
|
if (!widget.gameSession.isGameFinished)
|
||||||
CupertinoButton(
|
CupertinoButton(
|
||||||
onPressed: _areRoundInputsValid()
|
onPressed: _areRoundInputsValid()
|
||||||
? () {
|
? () {
|
||||||
_finishRound();
|
_finishRound();
|
||||||
LocalStorageService.saveGameSessions();
|
LocalStorageService.saveGameSessions();
|
||||||
if (widget.gameSession.isGameFinished == true) {
|
if (widget.gameSession.isGameFinished) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} else {
|
} else {
|
||||||
Navigator.pop(
|
Navigator.pop(
|
||||||
|
|||||||
@@ -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.3+476
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user