Skip to content

bottom_left_buttons

Janina Krueger edited this page Jul 13, 2022 · 1 revision

Side Switch Button (Issue #298)

This is implemented in side_switch.dart and is named SideSwitch. It is a simple TextButton which on pressing changes the attribute _attackIsLeft of the TempController and then applies

   Get.to(MainScreen(), preventDuplicates: false);

The parameter preventDuplicates: false makes the Main screen reload even though we are already in mainscreen. Otherwise the colors would only adapt after the first switch or otherwise reload of the screen.

Stop Game Button (done in Issue #213)

This is implemented in stop_game.dart and is named StopGameButton. It is a simple TextButton which on pressing opens an alert menu calling showDialog. The stopping of the game can still be canceled on pressing the cancel button in the dialog or just pressing anywhere else in the screen. On pressing OK, the function stopGame() of gameControl.dart is called, which updates the game parameters like scores and writes them to the db.

Clone this wiki locally