Added button state update in round view
This commit is contained in:
@@ -58,6 +58,11 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
_kamikazePlayerIndex =
|
_kamikazePlayerIndex =
|
||||||
gameSession.roundList[widget.roundNumber - 1].kamikazePlayerIndex;
|
gameSession.roundList[widget.roundNumber - 1].kamikazePlayerIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (var controller in _scoreControllerList) {
|
||||||
|
controller.addListener(_updateButtonState);
|
||||||
|
}
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,6 +342,7 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
/// Round Inputs are valid if every player has a score or
|
/// Round Inputs are valid if every player has a score or
|
||||||
/// kamikaze is selected for a player
|
/// kamikaze is selected for a player
|
||||||
bool _areRoundInputsValid() {
|
bool _areRoundInputsValid() {
|
||||||
|
print('Überprüfe, ob die Eingaben für die Runde gültig sind');
|
||||||
if (_areTextFieldsEmpty() && _kamikazePlayerIndex == null) return false;
|
if (_areTextFieldsEmpty() && _kamikazePlayerIndex == null) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -387,11 +393,18 @@ class _RoundViewState extends State<RoundView> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _updateButtonState() {
|
||||||
|
setState(() {}); // Erzwingt UI-Update
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
for (final controller in _scoreControllerList) {
|
for (final controller in _scoreControllerList) {
|
||||||
controller.dispose();
|
controller.dispose();
|
||||||
}
|
}
|
||||||
|
for (var controller in _scoreControllerList) {
|
||||||
|
controller.removeListener(_updateButtonState);
|
||||||
|
}
|
||||||
for (final focusNode in _focusNodeList) {
|
for (final focusNode in _focusNodeList) {
|
||||||
focusNode.dispose();
|
focusNode.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.1.6+145
|
version: 0.1.6+146
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user